Skip to content

Automatically update internal section references #13

@ryanragno

Description

@ryanragno

Firstly, this is a fantastic extension! Thank you!

It would be even better if it automatically updated the heading/section references within the markdown file. For example:

# 1. First heading
Here is some text.
# 2. Second heading
Here is some more text that references [Section 1](#1-first-heading).
Here is the same reference as a purely text label instead: [First heading](#1-first-heading).

When I insert a new heading, the TOC and heading numbers update perfectly, however the references to these headings throughout the document are not updated.

# 1. Newly inserted heading <!-- new section -->
# 2. First heading
Here is some text.
# 3. Second heading
Here is some more text that references [Section 1.](#1-first-heading). <!-- broken link 1 -->
Here is the same reference as a purely text label instead: [First heading](#1-first-heading). <!-- broken link 2 -->

The feature request(s) would be:

  1. To automatically update #1-first-heading to #2-first-heading in the references; and for bonus points.
  2. Optionally update the text label, if it finishes in a <space><number>, e.g. [Section 1](...) is also updated to [Section 2](...). I conceed that that is perhaps quite a bit harder to implement.

Thank you again for your work on this extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions