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 does not update correctly when the heading is a "short link" #1112

Open
unional opened this issue Apr 18, 2022 · 3 comments
Open

TOC does not update correctly when the heading is a "short link" #1112

unional opened this issue Apr 18, 2022 · 3 comments
Labels
Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations).

Comments

@unional
Copy link

unional commented Apr 18, 2022

Problem

- [Heading 1](#heading-1)

## [Heading 1]

[Heading 1]: http://some-link

When saved, the table to content changed to:

- [[Heading 1]](#heading-1)

## [Heading 1]

[Heading 1]: http://some-link

Which is incorrect.

Here is an example: https://github.com/justland/just-web/tree/main/libraries/react

🍻

@Lemmingh
Copy link
Collaborator

We are still arguing about it. See
#903 (comment)

@Lemmingh Lemmingh added the Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). label Apr 18, 2022
@unional
Copy link
Author

unional commented Apr 18, 2022

thx. but in this case it is not LaTeX math, but supported github markdown syntax.

Understand that it is probably a minor use case. For now, I'll change the usage to avoid the issue.

Just wanted to pointed out the issue. thx! 🌷

unional added a commit to justland/just-web that referenced this issue Apr 18, 2022
to avoid markdown all in one issue:
yzhang-gh/vscode-markdown#1112
@Lemmingh
Copy link
Collaborator

Different symptoms, but essentially the same topic:

How to generate TOC visible text. What to escape or remove.


In 2021-01 (January, 2021), I pushed a change (#877) to the development build which requires the text to be:

The rich text (single line Markdown inline without raw HTML) representation of the rendering result (in strict CommonMark mode) of the heading.
This must be able to be safely put into a [] bracket pair without breaking Markdown syntax.

However, a user soon found it breaking extended inline syntax (math). (#903)

  • I insist on knocking out any potentially dangerous pieces.
  • The user believes it's bug to not respect extended syntax.
  • Zhang is confused.

This is not the first time that users raise opposite requests. But the impact is too great.

So, stuck. The change has not been release, just lying in the codebase silently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations).
Projects
None yet
Development

No branches or pull requests

2 participants