Skip to content

Commit 8654204

Browse files
committed
[xhtml compat] Make sure linewap-padding is escaped
Closes #283
1 parent 494897e commit 8654204

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/codemirror.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,10 +1371,10 @@ var CodeMirror = (function() {
13711371
// Include extra text at the end to make sure the measured line is wrapped in the right way.
13721372
if (options.lineWrapping) {
13731373
var end = line.text.indexOf(" ", ch + 2);
1374-
extra = line.text.slice(ch + 1, end < 0 ? line.text.length : end + (ie ? 5 : 0));
1374+
extra = htmlEscape(line.text.slice(ch + 1, end < 0 ? line.text.length : end + (ie ? 5 : 0)));
13751375
}
13761376
measure.innerHTML = "<pre>" + line.getHTML(null, null, false, tabText, ch) +
1377-
'<span id="CodeMirror-temp-' + tempId + '">' + (line.text.charAt(ch) || " ") + "</span>" +
1377+
'<span id="CodeMirror-temp-' + tempId + '">' + htmlEscape(line.text.charAt(ch) || " ") + "</span>" +
13781378
extra + "</pre>";
13791379
var elt = document.getElementById("CodeMirror-temp-" + tempId);
13801380
var top = elt.offsetTop, left = elt.offsetLeft;

0 commit comments

Comments
 (0)