derlin / bitdowntoc

Online and command-line Markdown TOC generator, with built-in support for BitBucket Server, GitHub, Gitlab, dev.to and more!
https://bitdowntoc.derlin.ch
Other
82 stars 7 forks source link

Issue with producing header while having code block #14

Closed iamtodor closed 1 year ago

iamtodor commented 1 year ago

Hello,

I provide the following example of content when the generator table context does not work properly:


SQL table online

check

Examples

the fp

T:
 K | V
 1 | 3
 2 | 4
 3 | 4
 4 | 5
 5 | 5

test

having task

test

The service generates the following table of content:

<!-- TOC start (generated with https://github.com/derlin/bitdowntoc) -->

- [SQL table online](#sql-table-online)
- [Examples](#examples)

<!-- TOC end -->

Could you please take a look on why it does not consider the next paragraph having task, which comes right after Examples?

iamtodor commented 1 year ago

I also attached the .md file to make it more visible reproduce.md

derlin commented 1 year ago

Hello there! Thank you for using bitdowntoc.

The problem lies in your markdown, which has an extra space when closing your code block: '''

 5 | 5
 ''' <- here, extra space (assume single quotes are backticks)

If you remove the leading space on the closing backticks, bitdowntoc works as expected :)

iamtodor commented 1 year ago

@derlin Wow, thank you for a prompt solution! I didn't notice that space. Thank you so much for the great service!

derlin commented 1 year ago

My pleasure!