Forums

[resolved] Edit in HTML mode still adds lot of extra tags to my content (5 posts)

  1. winterheat
    Member
    Posted 1 year ago #

    I simply have the following lines in the HTML mode inside Edit Post:

    <code>
    ls         # list folder content
    ls -l      # list in detail format
    </code>

    and it looks like the above when I come back to Edit in HTML mode. However, when the blog is displayed, I see that all sorts of tags such as br tag <br> and sometimes even the paragraph tag <p> are added to the simple HTML above.

    So HTML is not the true HTML? It is still modified?

    What is a way to view and edit the RAW HTML?

  2. Use code for inline code:

    This is a code example: <code>foobar</code>

    and use PRE for those blocks:

    <pre>
    This is more code
    
    this is too
    </pre>
  3. planky
    Member
    Posted 1 year ago #

    I ended up using a plugin (TinyMCE Advanced) that stops the majority of <p>
    tags being added when switching between html and visual modes

  4. Planky, don't switch between modes. That way lies madness.

  5. winterheat
    Member
    Posted 1 year ago #

    ah, ok, i learned also that also a right way is to do:

    <pre><code>
    ls       # list content
    ls -l    # iist using detail format
    </code></pre>

    the <code> makes it semantic correctly as "computer code"... for the search engine to know they are computer code.

Topic Closed

This topic has been closed to new replies.

About this Topic