Add decode htmltext for comments

This commit is contained in:
Oleg Korshul
2025-04-16 13:25:39 +03:00
parent cfd753f777
commit 98293c787f

View File

@ -34,6 +34,16 @@
function Library() {}
function decodeHtmlText(text) {
return text
.replace(/"/g, '"')
.replace(/'/g, "'")
.replace(/&/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&nbsp;/g, ' ');
}
Library.prototype.GetEditorVersion = async function()
{
let version = await Editor.callMethod("GetVersion");
@ -100,7 +110,7 @@
{
return await Editor.callMethod("AddComment", [{
UserName : "AI",
Text : text,
Text : decodeHtmlText(text),
Time: Date.now(),
Solver: false
}]);