codemirror-node
Advanced tools
Comparing version 0.0.3 to 0.0.4
13
index.js
@@ -26,3 +26,9 @@ var CodeMirror = require("codemirror/addon/runmode/runmode.node.js"); | ||
function esc(str) { | ||
return str.replace(/[<&]/g, function(ch) { return ch == "&" ? "&" : "<"; }); | ||
const map = { | ||
'<': '<', | ||
'/': '/', | ||
'&': '&', | ||
'>': '>', | ||
}; | ||
return str.replace(/[<&\/>]/g, ch => map[ch]); | ||
} | ||
@@ -32,3 +38,6 @@ | ||
function flush() { | ||
if (curStyle) out += "<span class=\"" + curStyle.replace(/(^|\s+)/g, "$1cm-") + "\">" + accum + "</span>"; | ||
if (curStyle) { | ||
accum = esc(accum); | ||
out += "<span class=\"" + curStyle.replace(/(^|\s+)/g, "$1cm-") + "\">" + accum + "</span>"; | ||
} | ||
else out += accum; | ||
@@ -35,0 +44,0 @@ } |
{ | ||
"name": "codemirror-node", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Run codemirror on the server", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1813
45