chjj/marked — pull request #165 by ChrisWren (2013-06-01 20:45:00+00:00)
Title: Fixed argument typo for Lexer.lex() and fixed bug for async highlighting

My first commit fixes the argument typo for the Lexer.lex() function call for async highlighting, the same as #152.

Additionally, I noticed that when I was doing async highlighting and the markdown content didn't have a code section, it would never call the completion callback.

[This](https://github.com/ChrisWren/marked/blob/0c94d3ab64e70f3dcc2b4b76ed6a66171a6791ee/lib/marked.js#L1064) line of code was the only place where `done()` was invoked, and as you can see it is inside the highlighting callback. What I did is add a check for non-code tokens to see if there is no code highlighting pending when parsing the last token and call `done()` in that case.