Skip to content

Commit cc51b6b

Browse files
y-fujiibrson
authored andcommitted
fix escape
1 parent 016875b commit cc51b6b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/prep.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ while ((line = lines[cur++]) != null) {
6060
var html = '<pre class="cm-s-default">', curstr = "", curstyle = null;
6161
function add(str, style) {
6262
if (style != curstyle) {
63-
if (curstyle) html += '<span class="cm-' + curstyle + '">' + curstr
64-
+ "</span>";
65-
else if (curstr) html += curstr;
63+
if (curstyle) html +=
64+
'<span class="cm-' + CodeMirror.htmlEscape(curstyle) + '">' +
65+
CodeMirror.htmlEscape(curstr) + "</span>";
66+
else if (curstr) html += CodeMirror.htmlEscape(curstr);
6667
curstr = str; curstyle = style;
6768
} else curstr += str;
6869
}

0 commit comments

Comments
 (0)