evilstreak / markdown-js

A Markdown parser for javascript
7.7k stars 863 forks source link

Rewriting the count_lines function #67

Closed UncleBill closed 11 years ago

UncleBill commented 11 years ago

Faster and easier to read and understand, and higher performance.

ashb commented 11 years ago

Sorry we missed this pull request when you first opened it.

Do you have the benchmarking code you used to test this? I can believe it would be faster but I'm curious to see by how much (and what difference it makes in various engines.)

Also /\n+/ should be /\n/ otherwise you don't count double empty lines correctly - but it looks like there aren't any tests for this yet. Our bad.