Script execution halts when encountering HTML5 data- attributes

48 views
Skip to first unread message

Matthew Cieplak

unread,
Jan 21, 2013, 7:43:25 PM1/21/13
to writecaptu...@googlegroups.com
Hello,
I'm trying to test out the updated wc2  and having trouble getting it to run on some of our partners' ad content. It seems that something in the parser fails to correctly interpret html5 data- attributes on any kind of element. An example is here:


As you can see, everything after and including the line with the <a data-title=""> element fails to render, even though they are in separate JS statements.

I originally thought it had something to do with rendering iframes, but this does not appear to be the case. Here is the script that originally caused our issues:

Thanks for your help!

Matthew Cieplak

unread,
Jan 22, 2013, 4:10:16 PM1/22/13
to writecaptu...@googlegroups.com
Well, that campaign link has stopped delivering, but I think I've managed to locate the source of the problem. Element.write uses \w+ to match attribute names in startTag, whereas var "attr" uses the more liberal [\-A-Za-z0-9_]. I've changed it to [\w\-]+ and this seems to fix it. I'll submit a pull request presently. 
Reply all
Reply to author
Forward
0 new messages