nojronatron / markdown-toc

VSCode Extension adds table of contents to an existing markdown file.
https://marketplace.visualstudio.com/items?itemName=jon-rumsey-dev.jr-markdowntoc-vscode
MIT License
1 stars 0 forks source link

Dead Link Fragment generated for Level 2 Headings that contain many spaces #22

Open nojronatron opened 2 months ago

nojronatron commented 2 months ago

Describe the bug

In an Open ATX heading (possibly others), the rendered version of the Link Fragment mind fail to move focus to the Link Fragment target. Performing a link from within the Markdown (using 'CTRL + Click') appears to function.

To Reproduce

Steps to reproduce the behavior:

  1. Create a Level 2 Heading like '## Lots Of Spaces'
  2. Open the Control Palette and trigger 'Create TOC'
  3. Press 'Ctrl + Click' on the Link Fragment in the generated Table of Contents and observe the change in focus to the correct heading
  4. Click 'Markdown Preview' (if installed)
  5. Click the entry in the Table of Contents
  6. Observe that focus is not changed at all

Expected behavior

When clicking a valid, linted Link Fragment in the generated Table of Contents, focus should move to the correct Level 2 Heading within the same Markdown document.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

Additional context

None.