Skip to content

Commit 6364550

Browse files
committed
JI-942 Fix automatic title conversion
1 parent deff754 commit 6364550

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/h5peditor-editor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ ns.Editor.prototype.getContent = function (submit) {
295295
return;
296296
}
297297

298+
// Convert title to preserve html entities
299+
const tmp = document.createElement('div');
300+
tmp.innerHTML = content.title;
301+
content.title = tmp.textContent; // WARNING: This is text, do NOT insert as HTML.
302+
298303
library = new iframeEditor.ContentType(content.library);
299304
const upgradeLibrary = iframeEditor.ContentType.getPossibleUpgrade(library, this.selector.libraries.libraries !== undefined ? this.selector.libraries.libraries : this.selector.libraries);
300305
if (upgradeLibrary) {

0 commit comments

Comments
 (0)