Skip to content

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

@nojronatron

Description

@nojronatron

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

  • VS Code Version: 1.93.1 (user setup)
  • VS Code Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
  • VS Code Date: 2024-09-11T17:20:05.685Z
  • Electron: 30.4.0
  • ElectronBuildId: 10073054
  • Chromium: 124.0.6367.243
  • Node.js: 20.15.1
  • V8: 12.4.254.20-electron.0
  • OS: Windows_NT x64 10.0.22631 (Windows 11)
  • GitHub Markdown Preview extension v0.3.0 (May 2022)
  • Markdown Lint extension v0.56.0 (September 2024)

Additional context

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigateCause and behavior require additional investigation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions