Skip to content

Exclude trailing sentence punctuation from detected file links - #687

Merged
dakra merged 1 commit into
mainfrom
fix/link-trailing-punctuation
Sep 14, 2026
Merged

dakra merged 1 commit into
mainfrom
fix/link-trailing-punctuation

Conversation

@dakra

@dakra dakra commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Output like Handoff written to /tmp/notes.md. produced no link: the path regex absorbed the sentence-ending dot, so the candidate notes.md. failed the existence check.

The default of ghostel-file-detection-path-regex now ends the same way ghostel--url-regex does: the last path character is never one of .,;!?. Punctuation inside a path stays legal, and :LINE[:COL] tails were already unaffected.

Benchmarks (bench/run-bench.sh --case, two passes each, ITER ms):

case before after
detect/plain 2.76 / 2.82 2.66 / 2.68
detect/urls 6.48 / 6.25 6.35 / 6.21
detect/wrapped 4.86 / 4.90 4.65 / 4.76
e2e/urls/ghostel 10.01 / 10.05 10.70 / 9.94

All within run-to-run noise.

A path ending a sentence, like "written to /tmp/notes.md.", absorbed
the mark into the candidate and failed the existence check.  The path
regex now ends the same way the URL regex does: its last character is
never one of ".,;!?".
@dakra
dakra force-pushed the fix/link-trailing-punctuation branch from 221a252 to fd3c0c6 Compare September 14, 2026 10:49
@dakra
dakra merged commit fd3c0c6 into main Sep 14, 2026
33 checks passed
@dakra
dakra deleted the fix/link-trailing-punctuation branch September 14, 2026 10:53

This branch was successfully deployed

1 active deployment
github-pages — fd3c0c61 Deployed Sep 14, 2026 by dakra via deploy #189
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.

1 participant