Re: Stripping CSS single quotes

  •  09-03-2008, 11:45 PM

    Re: Stripping CSS single quotes

    Actually, it's a Firefox bahaviour as well. All 3 versions of Firefox (1,2,3). It would be nice to have it resolved, however in the meantime, I've simply created a post "clean-up" if you will via regular expressions.
     
    The thing is, if you were to "paste" a layout into it, no prob. However, the minute you view the "source" or submit the editing, it will then strip them.
     
    Possible Idea??....
    why not simply run a javascript regular expression if flopping between "normal & "html" modes and also upon submit?

    In fact, here's a quick script I wrote that I also implemented on my version for my site
    ....
     
    /*=====CODE SNIPPET SAMPLE=============*/
     
    var value="background: url(http://freelancerlisting.net)";
    var xpress=/url\(([a-zA-Z0-9:\/\.\?\&\=]+)\)/g;
    value=value.replace(xpress,"url('$1')");
    alert(value);
     
    /*=================================*/
     
    This basically will do a scan of the whole document for anything that matches the 'xpress' (regular express) and will do a global replace of the string you feed it. In this case, the var of 'value'. This script will add those missing 'single' quotes back into the url() css attribute.... cross-browser.
View Complete Thread