Skip to content

[BUG] Links to headings in the same document are not created #318

@foxblock

Description

@foxblock

Problem:
You can create links to headings in the same document in Obsidian by using [[#heading]]
These will not be turned into clickable links and will just show up as normal text in the rendered output.
As far as I can see only links with alternative link text (i.e. [[link|text]]) will be converted (see regex here). At some point in the pipeline alternative text is added to any normal link (i.e. [[link#optional-heading]]) that lacks it (turning it into [[link#optional-heading|link#optional-heading]]). But for some reason this is not done to links consisting only of a heading (so they will stay [[#heading]], not triggering the regex).

Expected result:
All links including those only linking to a heading should be converted into something along the lines of <a href="#heading">text</a>

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