Skip to content

Generated TOC Does Not Space Self Wisely #39

@nojronatron

Description

@nojronatron

Describe the bug

If the target markdown document has a newline linting error (meaning, there are non-bulleted sentences without a line-feed separating them) in the region where the new TOC is generated, the newline linting error will remain. This leaves a linting error where the generated TOC Header is placed.

Not a bug so much as a situation that the extension should be smart enough to handle without any negative side effects.

To Reproduce

  1. Create or open a markdown document that has a lint-passing structure with a single L1 header and at least one L2 header.
  2. Remove an LF between the L1 header (or its content) and the first L2 header.
  3. Open the Command Palette and select Create Table of Contents.
  4. See the lack of a LF between the L1 content and the L2 "Table of Contents" header.

Expected behavior

The extension will check to make sure there are two LFs before and following the generated Table of Contents is copies in.

Screenshots

None.

Environment

  • Version: 1.94.0 (user setup)
  • Commit: d78a74bcdfad14d5d3b1b782f87255d802b57511
  • Date: 2024-10-02T13:08:12.626Z
  • Electron: 30.5.1
  • ElectronBuildId: 10262041
  • Chromium: 124.0.6367.243
  • Node.js: 20.16.0
  • V8: 12.4.254.20-electron.0
  • OS: Windows_NT x64 10.0.22631

Additional context

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions