Boostnote: Table of contents is not rendered properly

Created on 23 Aug 2019  路  3Comments  路  Source: BoostIO/Boostnote

Current behavior

Generated TOC, doesn't handle headers with links properly.

Markdown code

# Main Header

<!-- toc -->

- [Sub-Header1](#Sub-Header1)
- [[Sub-Header2](https://google.com)](#Sub-Header2)

<!-- tocstop -->

## Sub-Header1
## [Sub-Header2](https://google.com)

Rendered as

image

Expected behavior

Markdown code

# Main Header

<!-- toc -->

- [Sub-Header1](#Sub-Header1)
- [Sub-Header2](#Sub-Header2)

<!-- tocstop -->

## Sub-Header1
## [Sub-Header2](https://google.com)

Rendered as

image

Environment

  • Version : 0.12.1
  • OS Version and name : Linux nil 5.2.9-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 16 11:29:43 UTC 2019 x86_64 GNU/Linux
bug level 1

Most helpful comment

From @malorie16's comment it looks as if this rendering of the TOC is intended as per our markdown renderer. I do, however, think that we should try to fix this issue within the TOC; mostly because it is generated by us.

My suggestion for a fix is that upon generating the TOC we remove all links. That way we can still generate links to jump within the note. Thus preventing this issue with nested links.

All 3 comments

I started taking a look at this bug and found that it could be something to do with the library they're using to parse their markdown. I copied and pasted this into numerous other open source markdown editors and got the same result. Even GitHub's markdown parser results in this:

From @malorie16's comment it looks as if this rendering of the TOC is intended as per our markdown renderer. I do, however, think that we should try to fix this issue within the TOC; mostly because it is generated by us.

My suggestion for a fix is that upon generating the TOC we remove all links. That way we can still generate links to jump within the note. Thus preventing this issue with nested links.

3080 is the exact complement to this issue: Generated link, doesn't handle TOC.

Was this page helpful?
0 / 5 - 0 ratings