Skip to content

Exclude headings inside tilde-fenced code from the documentation table of contents #45

Closed

Description

@LunaStev

Problem

markdownHeadings toggles inFence only on lines starting with triple backticks. A valid GFM ~~~ code block containing ## text creates a phantom TOC entry, while the rendered Markdown keeps that line inside code.

Evidence / regression scenario

Source-derived fixture: ~~~wave followed by ## not-a-heading and a closing ~~~ is currently included by markdownHeadings.

Code references

Audit baseline: 50eb207.

Completion criteria

  • Recognize both backtick and tilde fences with matching delimiter and sufficient closing length.
  • Do not treat a heading inside either fence form as navigation or let embedded shorter delimiters terminate a longer fence.
  • Add fixtures with tilde/backtick fences, language tags, nested-looking delimiters and real headings before/after.
  • Preserve existing Unicode anchor generation and duplicate-heading behavior.

Scope and dependencies

Difficulty: easy.

Bounded TOC extraction correction, not a new Markdown renderer or translation rewrite.

Backlog index: #12. Keep the change limited to this issue and include focused verification in the pull request.

Activity

  1. added
    bug
    documentation
    good first issue
    help wanted
    priority medium
    needs testing
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdocumentationgood first issuehelp wantedneeds testingpriority medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions