镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Fix mentions after a word - #425

Open
joshg253 wants to merge 1 commit into
interstellar-app:mainfrom
joshg253:fix/mention-after-word
Open

joshg253 wants to merge 1 commit into
interstellar-app:mainfrom
joshg253:fix/mention-after-word

Conversation

@joshg253

@joshg253 joshg253 commented Nov 6, 2026

Copy link
Copy Markdown

Mentions after a word (of the !fallout@lemmy.world) weren't recognized, and the email autolinker turned the address into a mailto: link. Mentions at the start of a line or after punctuation still worked, which is why it was easy to miss.

#418 made the mention pattern start with the whitespace before the mention, but tryMatch still checked the character before that whitespace as the boundary, which is a letter after a word. The check now only applies when the match doesn't start on whitespace. The space the pattern consumes is also kept, so "of the" doesn't run into the mention.

I checked it with unit tests (a mention after a word, at the start, after punctuation, and the spacing). They're in my fork, and I can add them here if you'd like, though the repo has no test setup yet.

Written with AI assistance (Claude Code) and reviewed by me.

🤖 Generated with Claude Code

The boundary check looked at the character before the whitespace that starts the mention pattern, so a mention after a word was rejected and the email autolinker made it a mailto link. Only check that character when the match doesn't start on whitespace, and keep the space the pattern consumed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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