The MU forums have moved to

be standard compliant (xhtml) (19 posts)

  1. enseignement
    Posted 17 years ago #

    How can I write and respect the standards (xhtml) ?
    Is there a plugin doing this ?
    If my users use TinyMCE, it is not compliant (I think). If they code themselves ... mmmm :s :-)

  2. lunabyte
    Posted 17 years ago #

    You need to understand standards, before you can adopt them. To understand standards, you need to know html.

    There isn't a magic plugin or pill to make a site standards compliant, and whether it's with the crutch editor, or the real non-visual editor, if you aren't careful you can break validation. Might be something as simple as a missing alt attribute, or something like that, but a user can kill it if without trying too hard.

    Really it's no harder than posting right here, other than you can add pictures and you have nice buttons to make things bold or whatever.

    Your best place to start is the W3C.

  3. enseignement
    Posted 17 years ago #

    Gné ...
    I know standards ...
    But I'm an user of Dotclear, another blog platform. There was a wiki editor for the articles, and it worked so good with a function like wiki2xhtml ... and I'm missing this feature right now.

    Administrator of (valid ;-) )

  4. drmike
    Posted 17 years ago #

  5. enseignement
    Posted 17 years ago #

    The idea is not to check afterwards, but to write in an editor that makes articles standards-compliant.
    If one blog tool can do it, I was wondering what exists in wp(and wpmu) ... And I guess I'm not the only one worrying about that issue

  6. drmike
    Posted 17 years ago #

    And I guess I'm not the only one worrying about that issue

    Really? I see they're voicing their support by posting here. :)

    Actually most of us tell our users to turn off TinyMCE and use the standard editor. It's known for producing errors.

    If you have one on another platform, why not try converting it to be used in WPMu? Either that or file bug reports with the TinyMCE folks.

    There's other editors you can use as well.

  7. KKWangen
    Posted 17 years ago #

    The only solution is to delete the Rich Text Editor, and make sure that all users have enough knowledge to close their tags when writing.

    And then you have to write long emails to any blogging fun sites and YouTube and telling them to stop creating copy/paste codes that belongs to html 3 the MSIE edition. And..

    Don't get me wrong, I care much about web standards, but the only thing you can do is to make sure that everyone has a good starting point, like valid themes and that no plugins start to render strange html codes. That's really all you can do.

  8. KKWangen
    Posted 17 years ago #

    Okay, I found some fixes you can do.

    Now; the Rich text editor produces

    by default if people like to change the font colour, and as most theme uses xhtml this will cause an invalid code. The fix on this is to open tiny_mce.js located in wp-includes/js/tinymce. Find the line:
    this._def("convert_fonts_to_spans", false);
    - around line 178 and set this to true. This will produce
    <span style="">

    If you'd like people to able to insert YouTube and Google videos in their posts you may check out the EasyTube plugin v.0.2 which has valid xhtml.

  9. jonlink
    Posted 16 years ago #

    Hmm... I think that ignoring the troubles with the RTE is a bit shortsighted. Yes, strict XHTML is easy to break, but why make it impossible to have valid code?

    By default WordPress should only output valid XHTML and let the users write invalid code :)

    Seriously though, it is bad to pretend it is fine that the rich text editor using things like <font> and <p align="center"> is okay. And it is even worse to say that users should use plain text editors. I'm willing to bet half the people using WordPress use it so that don't have to learn XHTML.

    I am writing a theme for a site that wont be used by folks with a technical inclination so that isn't going to happen. And it shouldn't have to happen. Right?

  10. jonlink
    Posted 16 years ago #

    Okay, rather then just b*tching (sorry, I'm a fan of standards and only breaking them when absolutely needed and I got a little worked up)...

    Does anyone know of an alternative editor that follows standards? I started hacking into tinyMCE, but that is a pretty bad solution since it will get broken with every update.

  11. andrea_r
    Posted 16 years ago #

    Then this should be taken up with the guy behind TinyMCE.

  12. drmike
    Posted 16 years ago #

    Preety much. TinyMCE has issues. Not trying to ignore them but there s a reason why it's suggested that the editor be turned off.

  13. jonlink
    Posted 16 years ago #

    Okay, so what about alternatives?

    As I said, I doubt even half the people using WordPress have any interest in learning X/HTML, and I don't think they should have to either.

    There is no reason there can't be a rich text editor and XHTML compliance, I personally don't see "turn off the editor" as a reasonable solution. No offense.

    That said, if there isn't an alternate editor there isn't one, I just hope one comes around soon— because I certainly don't want to try writing that one :)

    EDIT: it is worth mentioning also that things like align="center" don't always work. For instance this doesn't work:

    <p align="center">
    <object type="application/x-shockwave-flash" style="width:425px;height:350px;" data="">
    <param name="movie" value=""/></object>

    while this does:

    <p style="text-align:center">
    <object type="application/x-shockwave-flash" style="width:425px;height:350px;" data=""><param name="movie" value=""/></object>

    Though, I guess I am just preaching to the choir now.

  14. lunabyte
    Posted 16 years ago #


    Don't use strict, and use transitional instead. Problem solved.

  15. lunabyte
    Posted 16 years ago #

    Oh, and kses strips out all that stuff. As of 1.2.3, or was it 1.2.2, it's become even stricter.

  16. jonlink
    Posted 16 years ago #

    Use transitional?

    Why would I write a valid strict xhtml theme from scratch and then use transitional? Transitional is for code that can't be *updated* and validate as strict. We're talking about basic code that is being written everyday by low tech users. I want to make sure my sites code is valid in today and tomorrow's browsers. If I let users (my friends) post in poor code that means those post will either require clean up later or they will never be valid code.

    And if I just plain strip the bad code out things won't work right-- alignment for instance.

    I think I'm gonna work on my own solution in a few weeks when I have the time. If I come up with anything portable and useful I'll be sure to share it-- even if it doesn't seem in very high demand :p

  17. lunabyte
    Posted 16 years ago #

    I'm fully aware of what transitional is for. It's a completely valid option that it be considered as well. You can't control what a user does, and that's the plain facts. IF they use bad code, they use bad code.

    WP does a decent job at trying to un-f**k what an end user does, but it can't be perfect unfortunately. It happens. That's why you have to be flexible in your doctypes enough to be able to support it.

    No matter what you do, an end user is going to screw it up. That's just the facts of it. The best approach is to get as close as you can, and work with it.

  18. jonlink
    Posted 16 years ago #

    I understand that users will often create troubles, but I don't want the tools I am giving them to be the source of the trouble. While I respect that you feel using transitional is a legitimate solution I have to kindly disagree. I can't make you agree with me and I am unable to agree with you. That's okay.

    Since my users are pretty low-tech they won't be screwing with things in very difficult ways, so I should be able to keeps things under control pretty well. They aren't really writing code, they are just writing. So if I manage the code end it should be pretty close to perfect.

    To that end I wrote a plugin that replaces the align attribute with valid xhtml. If anyone is interested you can find it on my website, feel free to use/modify it as you'd like.

  19. RockyMtnHi
    Posted 15 years ago #

    Here is more info on this subject:

About this Topic

  • Started 17 years ago by enseignement
  • Latest reply from RockyMtnHi