Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Regular Expression to lowercase tags?

Back to Forum: Tech Off
  • User profile image
    Harlequin

    We have a bunch of HTML content and the editor turns tag attribute vaules to uppercase, like this:
    <span style="FONT-WEIGHT: bold; FONT-SIZE: 22px">text</span>

    We're trying to stick with XHTML so of course this is bad. Is there any way to have, maybe a regular expression that lowercases all tag attribute values? The tags and attributes themselves seem not to change in the editor(FCKEditor), just the values.

  • User profile image
    Cannot​Resolve​Symbol

    Harlequin wrote:
    We have a bunch of HTML content and the editor turns tag attribute vaules to uppercase, like this:
    <span style="FONT-WEIGHT: bold; FONT-SIZE: 22px">text</span>

    We're trying to stick with XHTML so of course this is bad. Is there any way to have, maybe a regular expression that lowercases all tag attribute values? The tags and attributes themselves seem not to change in the editor(FCKEditor), just the values.


    I wouldn't panic about it...  CSS isn't case-sensitive (XHTML is, but that only applies to element and attribute names, not their contents).

    [edit]  For example, this validates as XHTML 1.0 Strict:

    <!DOCTYPE html 
         PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Hello World!</title>
    </head>
    <body>
    <p id="testdiv" style="FONT-WEIGHT:bolder;">Hello.  How are you?</p>
    </body>
    </html>
    

  • User profile image
    Matthew van Eerde

    CannotResolveSymbol wrote:
    XHTML is, but that only applies to element and attribute names, not their contents


    In the FONT-WEIGHT case, yes... but <input type="RADIO" /> is a textbox.

  • User profile image
    stevo_

    Also, literal content attributes would turn incorect, such as value="blAh"

  • User profile image
    Harlequin

    We're using XHTML and AJAX, using the hidden frame technique. Click on link, and content in the hidden frame is sent to the displsy frame. Problem is that some things like a div with an image in it does not show up in IE, the space is there, but no image.....then 30 seconds later, the image shows up. Just figured it was this bad XHTML with uppercase attribute values making IE choke up.

    Note: This is IE6 and IE7, Firefox works fine.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.