fix(export): never emit punctuation-only Obsidian filenames (e.g. @.md)#1410
Closed
Mylock51 wants to merge 1 commit into
Closed
fix(export): never emit punctuation-only Obsidian filenames (e.g. @.md)#1410Mylock51 wants to merge 1 commit into
Mylock51 wants to merge 1 commit into
Conversation
An all-punctuation node label (e.g. `@/*` from a tsconfig paths entry) survived the unsafe-char strip in `to_obsidian`'s `safe_name()` as a bare `@`, producing `@.md`. That filename is valid on disk but empty once a downstream tool re-slugs on word chars — qmd's handelize() reduces "@" -> "" and raises, aborting the entire `qmd update` (every collection on the machine stops reindexing). Require at least one word char in the stem; otherwise fall back to "unnamed" (the existing dedup handles collisions). Applied to both safe_name occurrences. Fixes Graphify-Labs#1409 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
safishamsi
added a commit
that referenced
this pull request
Jun 22, 2026
…1409) Cover the #1410 fix: to_obsidian and to_canvas must never emit a punctuation-only filename (e.g. `@.md` from a `@/*` tsconfig paths key) — valid on disk but empty once a downstream tool re-slugs on word chars (crashes `qmd update`). Both tests exercise the public exporters and fail against the pre-fix safe_name(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
Merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1409.
Problem
to_obsidian()'ssafe_name()can produce a punctuation-only filename (e.g.@.md) when a node label is all-punctuation after the unsafe-char strip — e.g. a@/*node from atsconfig.jsonpathskey leaves a bare@, which is truthy and so slips past theelse "unnamed"fallback.The file is valid on disk but empty once a downstream tool re-slugs the stem on word chars. In particular it crashes
qmd update(handelize() reduces@→""and raises), and because qmd indexes collections in a batch, that one generated file aborts reindexing for every collection on the machine.Fix
Require at least one
\wchar in the stem; otherwise fall back to"unnamed". Applied to bothsafe_nameoccurrences (node export + community export). The existing dedup logic already disambiguates multipleunnamedcollisions.Behavior is unchanged for any label containing a word char (
@types/node→@typesnode.mdas before); only the pathological all-punctuation case changes.🤖 Generated with Claude Code