Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.
This repository was 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

@diglez

Description

@diglez

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions