Skip to content

@ character is not escapable #1168

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
spixi opened this issue Mar 6, 2018 · 20 comments
Open

@ character is not escapable #1168

spixi opened this issue Mar 6, 2018 · 20 comments

Comments

@spixi
Copy link

spixi commented Mar 6, 2018

User Story

As a GitHub user I want to make @ characters escapable to avoid the automatic mentioning of users.

Problem

In GitHub issue comments it is not possible to escape the @ character with the backslash. This may lead to unintended mentioning of other users. It is however possible to use the grave (`@`) or the zero width space (U+200B). Since the ZWSP is hard to find after you copy a table, I do not recommend it here. I first noticed the bug this issue.

Examples

Syntax Example Expected behavior Actual behavior
@spixi @spixi mention link mention link
\@spixi @spixi no mention link mention link
`@spixi` @spixi no mention link no mention link
@​spixi with ZWSP @​spixi no mention link no mention link
@Crissov
Copy link

Crissov commented Mar 8, 2018

Commonmark, unlike Gruber's original Markdown, allows all punctuation chars in U+0020..7F to be escaped with the backslash. Alas, Github's at-mention extension apparently works as a postprocessor on top of cmark-gfm and is not a part of its Autolinks extension.

@kivikakk
Copy link
Contributor

Indeed, we do postprocess to add @mentions to a document. By the time the \@ makes it to the part of the code that links users, the backslash has already been eaten by our Markdown processor. (I've been known to use the ZWSP trick myself.)

If CommonMark didn't allow escaping all punctuation in ASCII with a backslash, the Markdown processor would leave the backslash alone, and then we could detect it in the postprocess stage. If we added an exception here, we'd no longer be CommonMark-compliant — the documents @ and \@ should render identically.

There's no simple solution here, unfortunately.

@zopsicle
Copy link

zopsicle commented May 22, 2019

Found an easy way to escape at signs! E.g.: @chloekek. This doesn't insert code markup or ZWSPs.

@<!-- -->chloekek

@spixi
Copy link
Author

spixi commented May 22, 2019

@chloekek Nice finding. <!-- --> is used for comments in SGML and does not seem to be part of vanilla Markdown. Could this somewhere added to the help page?

@jzabroski
Copy link

(I've been known to use the ZWSP trick myself.)

@kivikakk What is the "ZWSP trick"? Zero-width space?

@chloekek Great solution!

@kivikakk See @spixi's suggestion that this get added to the help page. Zero-width spaces is a huge pain to type and interrupts the thought process while trying to compose messages.

@kivikakk
Copy link
Contributor

@jzabroski Yes, it stands for zero-width space.

I didn't write or have input on the docs — might need to get in touch with @github/product-docs-core? (This is a guess, sorry if I'm @mention'ing the wrong team!)

@lecoursen
Copy link
Member

@github/product-docs-core is the right team! First responder here... I opened https://github.com/github/help-docs/issues/11534 to track this issue. 😊

@tobek
Copy link

tobek commented Aug 5, 2020

Just want to add a real-world use-case for this feature, which is that the JSON-LD spec has various keywords that begin with the @ symbol, e.g. @context, @id, @type, etc. When discussing these on GitHub it's all too easy to not backtick them and then you have user mentions everywhere. (This is also happening in commit messages that reference these terms, though I don't really expect people to escape @ in commit messages.)

CyberShadow added a commit to dlang/dlang-bot that referenced this issue May 27, 2021
Geod24 pushed a commit to dlang/dlang-bot that referenced this issue May 27, 2021
* stop mentioning users when they create a PR

- creates notifications that seem fairly pointless given that people just created the PR
- not sure people with mail workflows have a different perspective on this

* dlangbot.github: Preserve formatting of fake mentions

Use the trick from
github/markup#1168 (comment).

* dlang-bot.test.comments: Update test suite

Co-authored-by: Vladimir Panteleev <[email protected]>
@broofa
Copy link

broofa commented May 9, 2022

Another use case: SCSS has a variety of @-rules that it would be nice to be able to mention in issues without pinging the corresponding users.

@BeratTezer
Copy link

BeratTezer commented Dec 7, 2022

Hey! I found this (‎ ‎‎‎‎‎). Thus I could add ``` into my code block on my readme.md file 😁

@adam-the
Copy link

escaping with \ (i.e \@user) is very much expected behaviour. Most platforms do this, Discord and Slack come to mind immediately.

Relevant:
calyxir/calyx#1640 (comment)
https://news.ycombinator.com/item?id=36888444

@adamkdean
Copy link

Poor @reset is going to miss the mentions

Copy link

github-actions bot commented Dec 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Dec 2, 2024
@jzabroski
Copy link

bump

@github-actions github-actions bot removed the Stale label Dec 3, 2024
Copy link

github-actions bot commented Feb 2, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Feb 2, 2025
@adam-the
Copy link

adam-the commented Feb 2, 2025

can we disable this bot? they are trying to censor us

@spixi
Copy link
Author

spixi commented Feb 3, 2025

It seems that this project is unmaintained. The last commit was 3 months ago and the pipeline contains many new issues of bad quality.
@jmeridth Can you have please have a look? Thank you.

@spixi
Copy link
Author

spixi commented Feb 3, 2025

@djdefi ?

@github-actions github-actions bot removed the Stale label Feb 3, 2025
Copy link

github-actions bot commented Apr 4, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Apr 4, 2025
@jzabroski
Copy link

still waiting for this feature

@github-actions github-actions bot removed the Stale label Apr 5, 2025
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

No branches or pull requests