Repository navigation
Strip leading and trailing dots from Obsidian note names - #522
Merged
Merged
Conversation
|
This is PR 1 of 10 you may keep open at a time. |
|
Start the description with The AI assistance section is missing from the PR description. Restore it from the PR template and disclose whether AI tools were used. |
1 similar comment
|
Start the description with The AI assistance section is missing from the PR description. Restore it from the PR template and disclose whether AI tools were used. |
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.
Summary
_stem/stemcleaned a note file name with a single pass of strip-whitespace, strip-dots, strip-whitespace. Stripping the dots could expose whitespace, and stripping that whitespace could expose more dots, which were left in place. A name like. .NETbecame.NET.md, a hidden file Obsidian does not index, so that entity's note and every link to it were missing from the vault. The pass was also not idempotent.Both SDKs now repeat strip-whitespace-then-dots until the value stops changing. The byte-length truncation path already recurses through the same cleanup, so a name cut mid-dot is trimmed too. A name left empty still falls through to the existing numbered fallback.
Linked issue
Closes #357
Checklist
src/selfgraph/_export.py,typescript/src/export.ts), identical behaviour.tests/test_trust.py,typescript/test/trust.test.ts) that fail on main and pass with the fix.vault_namesconformance pair with the dotted and truncated-then-dotted cases, so the two SDKs stay byte-identical.Breaking changes
None. Note names that were already valid are unchanged; only names with leading or trailing dots (after whitespace) change, and they become indexable.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.