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.
I have a very specific situation in which I want to insert a code similar to the below using postscribe:
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.