krux / postscribe

Asynchronously write javascript, even with document.write.
MIT License
986 stars 157 forks source link

Conditional comments cause next character duplication #102

Closed francoismassart closed 8 years ago

francoismassart commented 9 years ago

Hi there, We are using postscribe to inject (dirty) JavaScript code from advertising partners and as often for advertising scripts, we do not have control on the injected code.

Some advertising campaigns use flash media and within the html markup they use conditional comments...

We noticed that using their markup with postscribe creates a bug as you can see in the image below. bug After conducting different tests, I noticed that the first character following conditional comments was duplicated...

The BUG only happens when we use the "real" last version of the dist folder... The files inside the dist folder (https://github.com/krux/postscribe/tree/master/dist) are out of date, as explained https://github.com/krux/postscribe/issues/99

Here is a quick demo http://jsfiddle.net/9ga9sj2f/11/ The demo uses newer dist files generated from my fork of postscribe... All I did is changing the version number from 1.3.2 to 1.3.3, compile and run the tests.

francoismassart commented 9 years ago

I added a test about this BUG on the branch bug-conditional-comments... https://github.com/francoismassart/postscribe/tree/bug-conditional-comments

francoismassart commented 9 years ago

https://github.com/francoismassart/postscribe/commit/94c783b71bb608646c691f38472ac845581b8058 FIX the BUG... I'll create the pull request

davidbarratt commented 9 years ago

@francoismassart,

Has this been fixed in 1.4.0 ?

screenman commented 9 years ago

We have this issue in 1.4.0

sethyates commented 8 years ago

We believe this is fixed in 2.0.0. Please retest against 2.0.0 release and open a new issue following Issue Reporting guidelines in 2.0.0 if you believe this is still an issue.