Merge pull request #1155 from LinusU/patch-1

Use textContent to avoid manual escaping
This commit is contained in:
Nick O'Leary 2017-02-16 15:37:21 +00:00 committed by GitHub
commit 89769fb0e5
1 changed files with 1 additions and 1 deletions

View File

@ -1297,7 +1297,7 @@ RED.view = (function() {
sp.className = className;
sp.style.position = "absolute";
sp.style.top = "-1000px";
sp.innerHTML = (str||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
sp.textContent = (str||"");
document.body.appendChild(sp);
var w = sp.offsetWidth;
document.body.removeChild(sp);