mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-04-07 14:04:30 +08:00
Add decode htmltext for comments
This commit is contained in:
@ -34,6 +34,16 @@
|
||||
|
||||
function Library() {}
|
||||
|
||||
function decodeHtmlText(text) {
|
||||
return text
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'")
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/ /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
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user