thlorenz/doctoc — pull request #15 by michellebu (2013-05-01 03:18:07+00:00)
Title: Handle Windows carriage returns.

Currently the regex in `transform` does not work for some files created in Windows, in which a newline is represented by '\n\r'.

You can also choose to split by `/\r?\n/g` on line 88. Not splitting by `\r\n` is not a problem for the TOC though, since `\r` doesn't render.