• Most of my users are not technically oriented, and so probably won’t notice this kind of thing at all, but for myself, I’d love to know why WordPress gobbles up my inline style data. It also has a tendency to move element attributes around.

    Say I want to make a few words red. I try to write:
    <span style="color: #ff0000;">Headline News!</span>
    …but the resulting post has:
    <span>Headline News!</span>
    …and so does the raw post as seen in the editing window.

    Similarly, if I write:
    <img src="animage.png" border="1" height="188" hspace="10" width="250" align="right" />
    …I get:
    <img src="animage.png" align="right" border="1" height="188" hspace="10" width="250" />

    That’s not SO bad, but weird; like it’s doing extra work on the code when it doesn’t have to. Why won’t it just take what I give it? (And, incidentally, align=”right” isn’t valid HTML anymore, so why is the WYSIWYG editor be putting it out?)

    I’m using the plain text (“code”) editor. The WYSIWYG editor is horrific, if I may say so, and I renamed the directory where it lives to keep people from using it. (Incidentally, there seem to be a lot of forum topics about disabling this editor, and I don’t know about the rest of you, but there are NO options in either the site admin or the user admin pages for disabling the WYSIWYG editor. No check boxes, no select menus, nothing. I only see check boxes for Convert emoticons like ?? and ?? to graphics on display and WordPress should correct invalidly nested XHTML automatically.)

    Can someone tell me why WordPress does these shifty things? It’s discomfiting to enter something and have it stripped away without so much as a by-your-leave. Is there a way to keep WordPress from performing these naughty tricks? I know I’m new here, but it seems to me that software shouldn’t massage your data like this. If the user puts something ugly in, the user gets something ugly out, and must therefore correct it. The software should just do what it’s told. ??

    (edited to correct a typo)

Viewing 9 replies - 1 through 9 (of 9 total)
  • 1. For turning the wysiwyg animal off – for the whole site:
    admin > Options > Writing: Formatting uncheck the first checkbox!
    2. Turning off on a user level: admin Users > Your profile

    I agree, it should be banned. I am also inclined to never tell my clients about its existence ??
    If they need 3-5 “special” formatting things… I just create a few quicktag buttons for them and they are happy.

    I’m not sure if this applies here, but in WPMu, classes are being stripped out via the kses.php (for whatever reason). I’m not sure if that has translated over to WP itself. Might be worth comparing the new kses.php to the old one to see if maybe that’s what stripping or changing your style information.

    Also, even if you use the code editor, the kses will still strip out style information.

    Hmmm… I just tried in a freshly upgraded 2.2.1:
    copied the code from the OP and published in a post with the wysiwyg gizmo turned OFF. Not switching between visual and code. The rich text ediotr is killed.

    The html code the OP was complaining about stays exactly as written. No changes.

    Thread Starter zorkfox

    (@zorkfox)

    moshu: The first box on Admin -> Options -> Writing (“Convert emoticons like ?? and ?? to graphics on display”) is unchecked, and has been since I installed WordPress. It was one of the first things I turned off. (It has just occurred to me that I should have mentioned this is WordPress MU… I foolishly thought that mention of “my users” would imply it, but I ought to know better. ?? There is no similar box on Users -> Your Profile. In fact, there are no check boxes of any kind of that page. They are all text input except for a lone select menu about how to publicly display your name.

    This was the source of my criticism of the other posts that say they answered this question: I have no such boxes.

    peiqinglong: Thank you for the advice. I will look into this and see if I can disable the stripping.

    moshu (again): Both blogs on my site (the main blog, and a user blog I’ve been using to test) are recently updated to 2.2.1. I have not used the TinyCE editor, but when I post using inline style data, it’s still getting stripped. ?? It’s got to be WordPress MU that’s doing it. Sigh.

    Thank you all for your insight and help. I’ll report back what I find about peiqinglong‘s suggestion.

    Well, for MU you should NOT post here.
    https://mu.www.ads-software.com/forums

    And search first as we’ve already discussed it a couple of times and some are trying to convince the developers that it’s not a good idea.

    (Inline styles are removed by teh kses.php file I believe as a security risk)

    Thread Starter zorkfox

    (@zorkfox)

    Thank you, everyone. I apologize for my n00bish behavior. I’ll certainly seek help in the appropriate forum.

    WordPress should replaces their kses code with the code used in this modified version of kses — https://sourceforge.net/tracker/index.php?func=detail&aid=1752954&group_id=81853&atid=564260

    The modified kses produces better HTML, fixes bugs, allows CSS usage, etc.

    is there a resolution to this?

    as a plugin I am working on needs a little inline styling to make a nice box

    thanks,
    nada

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Why does WordPress Strip Style Information?’ is closed to new replies.