bitdowntoc icon indicating copy to clipboard operation
bitdowntoc copied to clipboard

Angle brackets in TOC entries causes... something

Open maurymarkowitz opened this issue 1 year ago • 4 comments

Some of my TOC entries have angle brackets, like:

### IF (*exp*) *lineno*{<cr>|;|[,*lineno*][{<cr>|;|,*lineno*]}}

When the TOC generation is run, the resulting anchors are "broken" and do not display properly.

I believe escaping these two characters during parsing would fix the issue.

maurymarkowitz avatar Jun 22 '24 13:06 maurymarkowitz

Hello there, and thanks for reporting the issue! Which profile are you using? Can you confirm all those characters are "regular" text (those are not markers for some another processing tool)?

derlin avatar Jun 22 '24 14:06 derlin

If I'm parsing the question correctly, I am using "Generic".

Those characters are regular text. You can see the source here (although I removed the bits in question so I could post a working TOC, so look a previous check-in):

https://github.com/maurymarkowitz/RetroFOCAL/blob/main/doc/RetroFOCAL%20reference%20manual.md

I inserted backslashes by hand and that does fix the problem.

maurymarkowitz avatar Jun 22 '24 14:06 maurymarkowitz

I have a hard time reproducing the issue. May I ask you for some more clarifications?

ONE Taking bot the old and new versions of the problematic anchor, I end up with exactly the same anchor generated:

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

- [IF (*exp*) *lineno*{<cr>|;|[,*lineno*][{<cr>|;|,*lineno*]}}](#if-exp-linenolinenolineno)
- [`IF` (*exp*) *lineno*{;|[,*lineno*][{;|,*lineno*]}}](#if-exp-linenolinenolineno-1)

<!-- TOC end -->

<!-- TOC --><a name="if-exp-linenolinenolineno"></a>
### IF (*exp*) *lineno*{<cr>|;|[,*lineno*][{<cr>|;|,*lineno*]}}
<!-- TOC --><a name="if-exp-linenolinenolineno-1"></a>
### `IF` (*exp*) *lineno*{;|[,*lineno*][{;|,*lineno*]}}

We can see the result is the same, as the second anchor has a -1 at the end. Can you provide me with a reproducible example of the issue? Was it really this line that posed problem?

TWO I see you are publishing your markdown on Github, any reason not to use the Github profile? (It may be broken as well, just wondering).

THREE the current version of your markdown seems outdated. Did you rerun bitdowntoc after changing the content? I see lots of diff when copying your current version to bitdowntoc (missing anchors, old titles, etc.) and broken links. Bitdowntoc is idempotent, but needs to be reran every time headers change in your TOC.

Thank you for your help!

derlin avatar Jun 23 '24 10:06 derlin

@maurymarkowitz any news?

derlin avatar Jul 14 '24 16:07 derlin

Closing due to inactivity.

derlin avatar Aug 31 '24 17:08 derlin