Closed jessethomson closed 4 years ago
Problem
indent.js not working in internet explorer 11 due to the way lines are split. Specifically, the following line does not work correctly:
https://github.com/zebzhao/indent.js/blob/033b5edfcf8ea34f8e8a010d88a91515e093e7d8/src/indent.js#L463
Example
In Chrome, this "test\n".split(/[\r]?\n/gi) produces:
"test\n".split(/[\r]?\n/gi)
["test", ""]
In IE11, this "test\n".split(/[\r]?\n/gi) produces:
["t", "e", "s", "t", " "]
Notes
Looks like there are a variety of issues with regular expressions in IE 11.
This seems to work in IE11 ("asdf\n" + "asdf\n" + "asdf\n").split("\n"), but I don't know if that works in all cases.
("asdf\n" + "asdf\n" + "asdf\n").split("\n")
It looks like this is actually caused by a bug in the String.prototype.split polyfill from core-js.
String.prototype.split
core-js
See https://github.com/zloirock/core-js/issues/751
Closing issue. Sorry for the false alarm!
Problem
indent.js not working in internet explorer 11 due to the way lines are split. Specifically, the following line does not work correctly:
https://github.com/zebzhao/indent.js/blob/033b5edfcf8ea34f8e8a010d88a91515e093e7d8/src/indent.js#L463
Example
In Chrome, this
"test\n".split(/[\r]?\n/gi)
produces:In IE11, this
"test\n".split(/[\r]?\n/gi)
produces:Notes
Looks like there are a variety of issues with regular expressions in IE 11.
This seems to work in IE11
("asdf\n" + "asdf\n" + "asdf\n").split("\n")
, but I don't know if that works in all cases.