How to count new lines in Internet Explorer?
- by Impirator
Hey, all. I'm doing my own syntax highlighter for Javascript and CSS, and I've run into an issue with Internet Explorer (big surprise). I grab all the contents of a code.block tag (example below) using innerHTML, and .split("\n") that result to get each line by itself. This works wonderfully except in IE.
I have tried using innerText and .split("\r\n") also without success. Can anyone recommend a solution? If it makes a difference, my code.block tags are styled to be white-space:pre-wrap.
<code class="block css">div#randomBarsDemo {
width:175px;
height:200px;
}
div#randomBarsDemo div {
background-color:#111;
width:100%;
}</code>