Cocoanetics / DTMarkdownParser

An event-based parser for markdown text
BSD 2-Clause "Simplified" License
197 stars 15 forks source link

Newline in Code Block #11

Closed odrobnik closed 10 years ago

odrobnik commented 10 years ago

If there is a newline inside a code block, then it causes the block to break into multiple pieces.

odrobnik commented 10 years ago

I think we should use this opportunity to unify handling of code block lines.

  1. scan document for block breaks (two NL or end of doc)
  2. blocks that have indentation of 4 spaces of one tab get all the same special line type PRE
  3. blocks between fencing back ticks get the same

Those lines would then get skipped by the other handling in _findAndMarkSpecialLines