WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPresse deleting html code (6 posts)

  1. ericthibeault
    Member
    Posted 6 years ago #

    Hello there,

    I'm working with WordPress 2.3 and I'm having an issue about WordPress deleting some html code of my pages. By explaining the workaround of what I do, I would like to know if any of you encountered this problem and/or is able to give me a solution.

    1. Go to your admin to create either a post or a page
    2. Enter the following code in the code section of the editor:
      <table>
      <caption>Test Caption</caption>
      <colgroup><col width="25%"><col width="75%"></colgroup>
      <tr class="odd">
      <td>Cell Top Left</td>
      <td>Cell Top Right</td>
      </tr>
      <tr>
      <td>Middle Top Left</td>
      <td>Middle Top Right</td>
      </tr>
      
      <tr class="odd">
      <td>Middle Bottom Left</td>
      <td>Middle Bottom Right</td>
      </tr>
      <tr>
      <td>Cell Bottom Left</td>
      <td>Cell Bottom Right</td>
      </tr>
      </table>
    3. Switch to the Visual section of the editor
    4. Now switch back to the code section of the editor and you should see that some html code is missing. For me the code is now:
      <table>
      <tr class="odd">
      <td>Cell Top Left</td>
      <td>Cell Top Right</td>
      </tr>
      <tr>
      <td>Middle Top Left</td>
      <td>Middle Top Right</td>
      </tr>
      <tr>
      <td>Cell Bottom Left</td>
      <td>Cell Bottom Right</td>
      </tr>
      </table>

      Missing the colgroup, the caption and a row

    Any help about this will be greatly appreciated?

    Thanks
    - ET

  2. moshu
    Member
    Posted 6 years ago #

    Switch to the Visual section of the editor

    Don't do that ever - if you input your html tags!
    The visual is for code illiterate people. If you know code, you don't need it, so turn it off. For good.
    admin > Users > Your profile.

  3. ericthibeault
    Member
    Posted 6 years ago #

    Hello Moshu,

    I totally agree with you that the visual is for code illiterate people, but the thing is that I'm not the only one creating/editing pages/posts on my wordpress since it is used as an Intranet. And some people doesn't know anything about html tags.

    Do you know if that deletion of code is a known bug of wordpress? In other words: Am I screwed if I need to go back and forth on Visual and code or there is a solution?

    Thanks!
    - ET

  4. moshu
    Member
    Posted 6 years ago #

    The visual animal can be turned on/off on user basis, so every user can have different settings.

    The ones that don't know anything about html... should NOT post any html. So, where is the problem?

    It is not really a "bug". The wysiwyg expects pure content (=text), not manually inserted code. And if it is ON, regardless of your switching between code/visual... it is ON when the post is saved, so all its idiocies are in effect.

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Do you know if that deletion of code is a known bug of wordpress?

    It's not a bug, it's by design. TinyMCE, when you switch to it, will redo your code according to a set of rules and such. Even WordPress itself will rework your HTML code, albeit not nearly as much.

    If you are using your own HTML code, then don't switch to the visual editor. Better yet, disable it entirely on your Profile page. This is a per-user setting, so some users can use the visual editor while others do not.

    The Visual editor does not expect you to know or use HTML code. It can deal with minor HTML just fine, like images and links and such, but it really wants text. If you want to input more than that, turn it off.

  6. ericthibeault
    Member
    Posted 6 years ago #

    Thanks guys!

Topic Closed

This topic has been closed to new replies.

About this Topic