Repository navigation
Conversation
A wiki link or a Markdown link target is a file name or a path. The linter treated a spaced hyphen inside one as an em-dash, so a note that links to [[Release Notes - Draft]] failed the PostToolUse check. strip_links() replaces a wiki link or embed with one placeholder word, like a code span or a URL. It keeps the visible text of a Markdown link and removes the target, so the link text is still linted. strip_code() and reader_check() both call it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
The
PostToolUsecheck reportsem_dashon a dash that is part of a file name.An Obsidian note links to other notes by file name, for example
[[myQ Accounting EAM - Architecture]]. The spaced hyphen in that name matches theDASHpattern. The hook then tells the agent to fix the hit. The agent cannot fix it, because a change to the name breaks the link. A Markdown link target such as[the guide](docs/Setup - Linux.md)has the same problem.The linter already exempts code spans and URLs for the same reason. SKILL.md also says to never touch file paths or identifiers.
Change
strip_links()inevals/ste_lint.pydoes two things:[[...]],![[...]]) with one placeholder word,LINK.(...)target.The link text is still linted, so a dash in the text a reader sees is still flagged.
strip_code()andreader_check()both call the new function, so the file check and the reply check agree. Newlines do not change, so the line numbers in hook output stay correct.Tests
LINK_FIXTUREhas four spaced dashes. Three are in link targets and one is in link text. Before this change the linter flags 4. After it, the linter flags 1, in bothlint()andreader_check(). A new hook test writes a note with dashed link targets and expects exit code 0.All four CI steps pass locally:
ste_lint.py --self-test,test_lint_hook.py(16 tests), the Node tests (12), andcheck_numbers.py.PR #42 also edits
strip_code(). If #42 merges first, I will rebase this PR on it.🤖 Generated with Claude Code