Page 1 of 1

For those WordPress users out there...

Posted: Fri Oct 02, 2009 8:39 am
by Kev
I'm new to WordPress, but am a seasoned designer/developer.

I'm playing around with the visual editor and when I highlight text and center align it (again, using the visual editor), it produces the following:

<p style="text-align: center;">My test text</p>

Are you kidding me? Is there something I'm missing here? I'm looking for standard-compliant XHTML (pref strict) and the visual editor only knows how to spit out deprecated style attributes?

If you want to only use XHTML strict markup, what are my options? Can I make the visual editor insert a class attribute in my <p> tag instead of a style attribute? Or do I need to forget about the visual editor completely and do everything by hand in the html editor?

I see all these themes out there claiming their theme is 100% XHTML Strict. Well what good is that if wordpress' editor spits out nothing but deprecated HTML?

I'm honestly looking for advice.. what my options are, what you guys do that want XHTML strict only, and was I asking too much of WP when I installed it? Thanks for any help.

Re: For those WordPress users out there...

Posted: Fri Oct 02, 2009 8:54 am
by arjan.top
since when is style attribute not valid in XHTML strict?

edit. it's deprecated, not invalid

Re: For those WordPress users out there...

Posted: Fri Oct 02, 2009 10:16 am
by matthijs
First of all, you can disable the visual editor in wordpress

Second, what do you expect from a visual editor? That when you move text to the center, that it goes into your stylesheet, checks which text styles are already there, if a center class doesn't exist yet add that to the stylesheet, etc? That's impossible.

And as arjan says, the style attribute is still valid in strict doctypes. i don't like it either, but still

However, it would be nice if there were better editors, in which you could define a certain set of your own style rules (which you have set in your stylesheets). Maybe such an editor already exists, haven't looked at it lately

Re: For those WordPress users out there...

Posted: Fri Oct 02, 2009 1:57 pm
by alex.barylski
Like said above, this isn't so much an issue with WordPress as it is with TinyMCE and all other editors, the exception being (maybe) XStandard which isn't browser based...disable the editor and use Markdown...thats what I do :)