gotwarlost/istanbul — pull request #138 by asifrc (2014-01-17 09:10:43+00:00)
Title: Fixed HTML reporter issue with Macintosh End-of-Lines (CR)

### Issue:
One of my projects was failing to generate html reports with the following error:
```
C:\code\node\buet73\node_modules\istanbul\lib\report\html.js:175
structuredText[lineNumber].covered = count > 0 ? 'yes' : 'no';
^
TypeError: Cannot set property 'covered' of undefined
at C:\code\node\buet73\node_modules\istanbul\lib\report\html.js:175:66
```

I have no idea why, but it turns out my editor somehow was using Macintosh line-endings (`\r`) instead of the usual Windows(`\r\n`) or Unix(`\n`) EOL characters.

### Solution:
I replaced the Regular Expression `/\r?\n/` in lib/report/html.js with `/(\r?\n|\r)/` so that it will return matches for Unix, Windows, and Macintosh line endings when splitting the body of the code into an array of lines.
I additionally added tests for EOL variations to test/cli/test-html-report.js, so that they're accounted for.

I realize that this issue might not be encountered by very many people, but I did happen to come across it and thought that this minor fix might be helpful.