vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

TOC does not ignore headers in fenced code blocks #48

Closed FSX closed 12 years ago

FSX commented 12 years ago

When generating a table of contents all the headers in fenced code blocks are listed too.

See "Header one" and "Header two" in the TOC: http://misaka.61924.nl/. And you can see both headers in the 4th code block under Usage. This is the source file: https://github.com/FSX/misaka/blob/master/docs/documentation.md

vmg commented 12 years ago

Hm. Right on, that's because the TOC renderer needs to be run with the same flags as the normal renderer. Have you tried passing the FENCED_CODE_BLOCKS extension to sd_markdown with the TOC renderer?

FSX commented 12 years ago

That worked, thanks. I wasn't passing any extension parameters with the TOC function. Didn't think it would make a difference.

That'll be another bugfix release tomorrow.