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

Postscribe detects a greater than sign inside a script as a closing tag and adds a data-ps-id that is breaking the code #509

Open
diglez opened this issue Apr 9, 2021 · 0 comments

Comments

@diglez
Copy link

diglez commented Apr 9, 2021

I have a very specific situation in which I want to insert a code similar to the below using postscribe:

<img src="data:image/png,ft" style="display: none" onerror="
        (function(img) {
            console.log('dummy function');
            console.log('that references ' + img);
            //and also has a conditional sort of like this
           if (10 > 8) { console.log('obviously'); } // MAIN ISSUE IS HERE 
           else { console.log('but only works with less than'); }
        })(this);
    ">

I know it is quite a strange code but that's how we get it sometimes form clients. The issue is that the > sign in the conditional is being detected by postscribe as the closing > for the img, which is causing a data-ps-id to show up and break the js code...

Here's an example showing the code with a > sign and then again with a < sign. The one with < works fine and prints all the expected outputs.

Screen Shot 2021-04-09 at 12 16 18 PM

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

No branches or pull requests

1 participant