Skip to content

fix(parser): extract wikilinks and embeds from YAML frontmatter#7

Merged
nicholasjpaterno merged 1 commit intoEpistates:mainfrom
Combustion-Technology:main
Mar 22, 2026
Merged

fix(parser): extract wikilinks and embeds from YAML frontmatter#7
nicholasjpaterno merged 1 commit intoEpistates:mainfrom
Combustion-Technology:main

Conversation

@AntttMan
Copy link
Copy Markdown
Contributor

Obsidian vaults commonly store wikilinks in frontmatter fields:

Area: "[[My Hub]]"
Links:
  - "[[Doc A]]"
  - "[[Doc B]]"

Previously, the parser stripped frontmatter before the regex pass, making these links invisible to the link graph, broken link detection, and backlink counts.

The fix adds a dedicated frontmatter scan between Phase 1 (pulldown-cmark) and Phase 2 (body regex) that extracts [[wikilink]] and ![[embed]] patterns from the raw YAML text using the same regexes as the body pass. Found links are appended to the existing wikilinks/embeds vectors, so downstream graph resolution and health analysis work without any changes.

Changes:

  • Add parse_frontmatter_wikilinks() method to ParseEngine
  • Call it from parse() when frontmatter exists and wikilinks are enabled
  • 12 new tests covering all frontmatter link scenarios

No changes to turbovault-graph, turbovault-tools, or any other crate.

Obsidian vaults commonly store wikilinks in frontmatter fields:

    Area: "[[My Hub]]"
    Links:
      - "[[Doc A]]"
      - "[[Doc B]]"

Previously, the parser stripped frontmatter before the regex pass,
making these links invisible to the link graph, broken link detection,
and backlink counts.

The fix adds a dedicated frontmatter scan between Phase 1 (pulldown-cmark)
and Phase 2 (body regex) that extracts [[wikilink]] and ![[embed]] patterns
from the raw YAML text using the same regexes as the body pass. Found links
are appended to the existing wikilinks/embeds vectors, so downstream graph
resolution and health analysis work without any changes.

Changes:
- Add parse_frontmatter_wikilinks() method to ParseEngine
- Call it from parse() when frontmatter exists and wikilinks are enabled
- 12 new tests covering all frontmatter link scenarios

No changes to turbovault-graph, turbovault-tools, or any other crate.
@nicholasjpaterno
Copy link
Copy Markdown
Contributor

Thanks for making another PR @AntttMan i’m taking a look now!

@nicholasjpaterno nicholasjpaterno merged commit 038715b into Epistates:main Mar 22, 2026
1 check passed
@nicholasjpaterno
Copy link
Copy Markdown
Contributor

Perfect, thanks for this one @AntttMan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants