Skip to content

Escape auto-linked GitHub usernames more precisely #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thaliaarchi
Copy link

@thaliaarchi thaliaarchi commented Mar 7, 2025

More precisely match how GitHub auto-links usernames when escaping usernames to suppress pings.

Perhaps most noticeably, this now keeps punctuation outside of the escaped username.

You can verify that this matches GitHub's behavior by copying the test string (with strings concatenated and \ns resolved, of course) into a Markdown editor on GitHub and comparing what is auto-linked when rendered.

Improves upon #100.

@thaliaarchi thaliaarchi force-pushed the precise-username-escaping branch from 670b952 to e25ca63 Compare March 7, 2025 04:04
More precisely match how GitHub auto-links usernames when escaping
usernames to suppress pings.

Perhaps most noticeably, this now keeps punctuation outside of the
escaped username.
@thaliaarchi thaliaarchi force-pushed the precise-username-escaping branch from e25ca63 to 184c2df Compare March 7, 2025 04:06
@thaliaarchi
Copy link
Author

CI has really picky code style 😅

@thaliaarchi
Copy link
Author

This needs handling of teams. Since I'm not in @rust-lang, I had overlooked that, since my UI doesn't render @rust-lang/libs as a link. I'll be implementing that.

@Kobzol
Copy link
Contributor

Kobzol commented Mar 27, 2025

Just noting that performing non-trivial changes to homu might be a bit futile at the moment. We're in the processing of reimplementing the bot in Rust (https://github.com/rust-lang/bors).

Created an issue for this: rust-lang/bors#258.

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.

2 participants