For those WordPress users out there...

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Kev
Forum Newbie
Posts: 21
Joined: Tue Aug 25, 2009 9:11 pm

For those WordPress users out there...

Post 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.
User avatar
arjan.top
Forum Contributor
Posts: 305
Joined: Sun Oct 14, 2007 4:36 am
Location: Hoče, Slovenia

Re: For those WordPress users out there...

Post by arjan.top »

since when is style attribute not valid in XHTML strict?

edit. it's deprecated, not invalid
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: For those WordPress users out there...

Post 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
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: For those WordPress users out there...

Post 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 :)
Post Reply