Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOC has unexpected behavior when not top of note #1602

Closed
toddfoster opened this issue May 28, 2019 · 4 comments · Fixed by #1603
Closed

TOC has unexpected behavior when not top of note #1602

toddfoster opened this issue May 28, 2019 · 4 comments · Fixed by #1603

Comments

@toddfoster
Copy link

Operating system

  • macOS
  • iOS

Application

  • Desktop
  • Mobile

When I leave a title for my note at the very top (which is conveniently copied into the empty title of a new note: thanks!), and throw in a [toc] on the next line, I end up with three tables of contents. If I remove that title so that the [toc] is at the very top of the note, then I get the expected behavior (only a single table of contents).

Screen Shot 2019-05-28 at 14 50 15

@CalebJohn
Copy link
Collaborator

If you leave a newline before the [toc] you also get the correct behaviour.
e.g.

Title

[toc]

Body...

This is probably a bug with the toc plugin that joplin uses.

@toddfoster
Copy link
Author

That makes a certain kind of sense. I've experienced at least one markdown parsers than required newlines between different block elements. Joplin seems pleasantly tolerant (other than with toc!).

I made a quick test with the demo.html from markdown-it-toc-done-right without reproducing the issue, but that's a pretty different use case.

This may not be an issue worth pursuing: a note in a doc might be helpful, though. Or this (closed) bug report might be adequate.

@CalebJohn
Copy link
Collaborator

That's interesting, I notice that the demo uses slightly different version of markdown-it markdown-it-anchor and of course it uses the cutting edge version of the toc plugin. This could be fixed already in one of those libraries.

@CalebJohn
Copy link
Collaborator

After some quick testing it was clear that this was a bug that had been fixed in the newest version of the plugin, but since the plugin isn't very transparent about those things it was clear at first.

@lock lock bot locked and limited conversation to collaborators Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants