We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0cff44 commit a25bcf7Copy full SHA for a25bcf7
src/highlightjs-line-numbers.js
@@ -30,7 +30,11 @@
30
var parent = element.parentNode;
31
var lines = parent.outerText.match(/\n/g);
32
33
- lines = (lines ? lines.length : 0);// TODO: for IE + 1;
+ lines = lines ? lines.length : 0;
34
+
35
+ // fix for IE
36
+ if (isIE()) lines += 1;
37
38
if (lines > 1) {
39
var l = '';
40
for (var i = 0; i < lines; i++) {
@@ -45,4 +49,9 @@
45
49
parent.insertBefore(linesPanel, element);
46
50
}
47
51
52
53
+ function isIE(userAgent) {
54
+ userAgent = userAgent || w.navigator.userAgent;
55
+ return userAgent.indexOf("MSIE ") > -1 || userAgent.indexOf("Trident/") > -1;
56
+ }
48
57
}(window));
0 commit comments