Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Can't handle slightly corrupted HTML #6

Open
sethyates opened this issue Apr 12, 2016 · 0 comments
Open

Can't handle slightly corrupted HTML #6

sethyates opened this issue Apr 12, 2016 · 0 comments
Labels

Comments

@sethyates
Copy link

Browsers can handle this:

document.write('<img src"abc.jpg"><div>WORKS</div>')

Well Firefox prints <img src"abc.jpg"="">, but the div is still there.

Postscribe can't handle this.

<html>
<style>img { display: none }</style>
<div id="js">
<script>document.write('<img src"abc.jpg"><div>OK</div>')</script>
</div>
<div id="ps1"></div>
<div id="ps2"></div>
<script src="https://raw.github.com/krux/postscribe/master/dist/postscribe.js"></script>
<script>
postscribe('#ps1', '<script>document.write(\'<div>OK</div>\')</sc' + 'ript>');
postscribe('#ps2', '<script>document.write(\'<img src"abc.jpg"><div>OK</div>\')</sc' + 'ript>');
</script>
</html>

Expected behavior: 3 times OK. Actual behavior: 2 times OK

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant