Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accented characters in SCT's incorrect_msg and success_msg #192

Open
basteks opened this issue Aug 25, 2021 · 0 comments
Open

Accented characters in SCT's incorrect_msg and success_msg #192

basteks opened this issue Aug 25, 2021 · 0 comments

Comments

@basteks
Copy link

basteks commented Aug 25, 2021

Hello everyone,
While trying to insert accented characters in the incorrect_msg or success_msg of the <code data-type="sct"> tag, they always appear replaced by [removed] (either typing them directly or using encodeURI() which works well for the <div data-type="hint"> tag).
I found a workaround by slightly modifying the StripTagBody function in dcl-react.js.gz :
I replaced the return i || (i = c.position), "[removed]"; statement by

var html = String.fromCharCode("0x" + s.substring(2)).replace(/[\u00A0-\u9999<>\&]/g, function(z) {
		return '&#'+z.charCodeAt(0)+';';
});
if (html.substring(0,2)=="&#") {
return i || (i = c.position), html;
}
else {
return i || (i = c.position), "[removed]";
}

Same can be done in dcl-react-dev.js.gz, only param s is now called tag and we only returned var html or string "[removed]" without i || (i = c.position),

Do you think you could integrate this enhancement in the cdn hosted versions of dcl-react ?
Best regards,
Benjamin

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

No branches or pull requests

1 participant