Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Component-Other

New issue 1922 by [email protected]: Caja does not strip downlevel-revealed conditional comments [possible fix included]
http://code.google.com/p/google-caja/issues/detail?id=1922

What revision of the cajoler exhibits the problem?  On what browser and OS?

svn HEAD - all platforms

What steps will reproduce the problem?

var example = caja.makeSaxParser({
pcdata : function(x) { if (/vml/.test(x)) throw new Error("not stripping downlevel-revealed conditional") },
});
example('<![if !vml]>foo<![endif]>');

What is the expected output? What do you see instead?

It throws the exception. It shouldn't if caja is to handle (drop) these, admittedly, annoying junk tags.

Please provide any additional information below.

http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx#dlrevealed

these are pretty common in emails, which is the use case I'm looking at here.

I've "fixed" this issue by changing:

        case '<\!':
          if (!/^\w/.test(next)) {
            if (h.pcdata) {

to:

        case '<\!':
          if (!/^(\w|\[)/.test(next)) {
            if (h.pcdata) {

In parseCPS function, to catch it along with doctype declarations and the like. But of course I'm not sure that's right, having only a cursory understanding of the code.

I tried to run the tests, but seemingly did not have enough memory on this machine!

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to