Skip to content

Conversation

@benniekiss
Copy link
Contributor

@benniekiss benniekiss commented Nov 1, 2025

Description

This PR adds sanitization to H1 headings when they are extracted for file display.

Closes #5980
Closes #5966

Changes

Instead of assigning firstHeading to the heading node content, the plain text is extracted using extractTextNodes. This removes any markup that is in the heading.

The extractTextNodes function was refactored to include the ZettelkastenLink title, which matches Link and Image nodes.

Additional information

Title:

Screenshot 2025-11-01 at 13 11 28

Current:

Screenshot 2025-11-01 at 13 11 35

PR:

Screenshot 2025-11-01 at 13 05 35

Tested on: macOS 26

@benniekiss
Copy link
Contributor Author

The latest commit refactors the ast extractors into a switch statement, matching the node parser structure and making it much more readable in my opinion.

I also believe I was able to fix #5966. All that was missing was the Header node in the children extractor guard.

@richdouglasevans
Copy link
Contributor

Conan, what is best in life? 🤔

"To crush your enemies, see them driven before you, and to see another zarjaz PR from BennieKiss!"

I am McLovin' your work Bennie, rock on! ✌️ LGTM.

@benniekiss benniekiss mentioned this pull request Nov 4, 2025
3 tasks
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.

Unlink internal links in file manager, search, auto-label, etc. Links made in first header not populating graph or backlinks.

2 participants