• When I use the HTML tab when editing a post, I create a pre tag like so:

    <pre lang="cmake" line="1">add_executable( helloworld main.cpp )</pre>

    However, when I switch back to the “Visual” tab, and then switch back again to “HTML”, it has stripped the “line” attribute from my pre element. Why is it doing this? I’m using the WP-Syntax plugin and it is important for WordPress to not strip my line attribute.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It’s doing that because you switched between visual and html editing. Don’t do that. Pick one and stick by it.

    Agreed.

    I personally disable the visual editor entirely. It’s the first thing I do when I create a new account or a new blog somewhere. I really, really dislike the visual editor.

    Pick one and stick with it. Switching between the two is still not perfect, so it’s just someone we must live with.

    Thread Starter rcdailey

    (@rcdailey)

    I actually like the visual editor better. It is especially better when including images in your posts. I’m not that great with HTML/CSS, so wrapping text around images isn’t that easy for me.

    I also don’t see how you guys can choose HTML raw editing over a nice user interface. I can work more quickly in the user interface.

    For many people, including myself, switching back and forth between visual and html works with no problem. If you have a problem with it, something else is causing it.

    But since “line” is not an attribute for “pre” in XHTML transitional perhaps the problem is based on improper code.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    For many people, including myself, switching back and forth between visual and html works with no problem. If you have a problem with it, something else is causing it.

    That’s not wrong but it’s a little to-MAY-to/to-MAH-to IMO. I mean, if switching back and forth breaks your code, then yeah, it’s your code. But if it only breaking because you switch back and forth, then it’s the switching too. So either don’t switch back and forth or don’t use the code.

    I also don’t see how you guys can choose HTML raw editing over a nice user interface. I can work more quickly in the user interface.

    I tend to write and THEN format, but then again, I don’t do a whole lot of fancy formatting.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Problem with <pre> in HTML editor’ is closed to new replies.