Skip to content

feat(rule): link check to include frontmatter links#41

Merged
jackchuka merged 1 commit intomainfrom
feat/rule/2026-02-06-frontmatter-link
Feb 6, 2026
Merged

feat(rule): link check to include frontmatter links#41
jackchuka merged 1 commit intomainfrom
feat/rule/2026-02-06-frontmatter-link

Conversation

@jackchuka
Copy link
Owner

This pull request enhances the link validation logic to support and validate links specified within frontmatter metadata in Markdown documents. The changes ensure that URLs and internal anchors in frontmatter are subject to the same validation rules (blocked/allowed domains, internal anchor checks) as those in the main content. It also adds comprehensive tests to cover these scenarios.

Frontmatter Link Extraction and Validation:

  • Added a new function extractFrontmatterLinks in extractor.go to extract link-like values (URLs and anchors) from frontmatter data, storing them in the Links field of the FrontMatter struct. [1] [2]
  • Modified the parser (parser.go) to populate the new Links field in the FrontMatter struct during document parsing.
  • Updated the link validation rule (link.go) to include links from frontmatter in its validation checks.

Testing Enhancements:

  • Added a suite of tests in link_test.go to verify validation of frontmatter links, including checks for blocked/allowed domains, internal anchors, and non-string values.
  • Added a new integration test case and test data for a document with a blocked domain in frontmatter. [1] [2]

@jackchuka jackchuka marked this pull request as ready for review February 6, 2026 02:40
@jackchuka jackchuka merged commit 8a72e9c into main Feb 6, 2026
1 check passed
@jackchuka jackchuka deleted the feat/rule/2026-02-06-frontmatter-link branch February 6, 2026 02:40
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 9, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jackchuka/mdschema](https://github.com/jackchuka/mdschema) | minor | `v0.9.0` → `v0.11.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jackchuka/mdschema (jackchuka/mdschema)</summary>

### [`v0.11.0`](https://github.com/jackchuka/mdschema/releases/tag/v0.11.0)

[Compare Source](jackchuka/mdschema@v0.10.0...v0.11.0)

#### What's Changed

- feat(rule): link check to include frontmatter links by [@&#8203;jackchuka](https://github.com/jackchuka) in [#&#8203;41](jackchuka/mdschema#41)

**Full Changelog**: <jackchuka/mdschema@v0.10.0...v0.11.0>

### [`v0.10.0`](https://github.com/jackchuka/mdschema/releases/tag/v0.10.0)

[Compare Source](jackchuka/mdschema@v0.9.1...v0.10.0)

#### What's New

**Introduce GitHub Action**

#### What's Changed

- fix: release tag filter by [@&#8203;jackchuka](https://github.com/jackchuka) in [#&#8203;39](jackchuka/mdschema#39)
- fix: release tag align by [@&#8203;jackchuka](https://github.com/jackchuka) in [#&#8203;40](jackchuka/mdschema#40)

**Full Changelog**: <jackchuka/mdschema@v1...v0.10.0>

### [`v0.9.1`](https://github.com/jackchuka/mdschema/releases/tag/v0.9.1)

[Compare Source](jackchuka/mdschema@v0.9.0...v0.9.1)

#### What's Changed

- feat: generate heading title from literal by [@&#8203;takeoverjp](https://github.com/takeoverjp) in [#&#8203;37](jackchuka/mdschema#37)

#### New Contributors

- [@&#8203;takeoverjp](https://github.com/takeoverjp) made their first contribution in [#&#8203;37](jackchuka/mdschema#37)

**Full Changelog**: <jackchuka/mdschema@v0.9.0...v0.9.1>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Ni4wIiwidXBkYXRlZEluVmVyIjoiNDIuOTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
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.

1 participant