note-properties/src
saberzero1 3539cf1e6a
fix: slugify wikilinks in frontmatter to prevent %20 in hrefs
Wikilinks appearing in frontmatter property strings (e.g. 'related:
"[[My Note]]"') were rendered with their raw target passed
directly to resolveRelative, leaving the space intact. The browser
then percent-encoded it as %20 in the rendered href, producing
broken links like './My%20Note' that never resolve.

The root cause was in renderTextWithLinks (NoteProperties.tsx):
the matched wikilink target went straight into resolveRelative
without going through slugifyFilePath, so spaces, ampersands, and
other characters that should be slugified survived into the href.
extractLinksFromValue (transformer.ts) had the same issue: it
stored raw target strings in file.data.frontmatterLinks instead
of canonical slugs.

Adds a shared slugifyWikilinkTarget helper in util/path.ts that
mirrors the slug+anchor contract CrawlLinks uses for body-content
links, so frontmatter wikilinks and body wikilinks now produce
identical hrefs. Both NoteProperties.tsx and the transformer's
extractLinksFromValue now go through this helper.

Also replaces the plugin's local slugTag/slugifyFilePath/
getFileExtension helpers with the shared @quartz-community/utils
versions. This eliminates slugification drift between plugins and
ensures that note-properties honors the same case-insensitive
matching that the rest of the Quartz ecosystem uses.

BREAKING CHANGE: tag URLs and frontmatter-wikilink slugs are now
lowercased (inherited from utils' case-insensitive matching).
Tags #MyTag, #mytag, and #MYTAG collapse into a single tag page
tags/mytag.
2026-04-16 22:22:10 +02:00
..
components fix: slugify wikilinks in frontmatter to prevent %20 in hrefs 2026-04-16 22:22:10 +02:00
i18n feat: implement note-properties plugin 2026-02-22 23:40:23 +01:00
util fix: slugify wikilinks in frontmatter to prevent %20 in hrefs 2026-04-16 22:22:10 +02:00
index.ts feat: implement note-properties plugin 2026-02-22 23:40:23 +01:00
transformer.ts fix: slugify wikilinks in frontmatter to prevent %20 in hrefs 2026-04-16 22:22:10 +02:00
types.ts feat: implement note-properties plugin 2026-02-22 23:40:23 +01:00