-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
[bug] Detection of mentions and hashtags in markdown can be improved #789
Comments
okay so, after #1267, the behavior of this is slightly different - specifically the Note that this issue is now also relevant to mentions -- the new mention parser actually requires that mentions be preceded by whitespace. It might make sense to make the allowed preceding characters for mentions and hashtags be the same, for consistency. Fixing this issue would require changing which characters can precede or close a hashtag. Aside: there are some parts of So it would be sufficient to say that mentions/hashtags can be preceded only by whitespace or punctuation, and similarly for the character that comes after. That would mean that, after unicode normalisation (thanks @illfygli), anything that is not a number or letter, found before whitespace or punctuation, causes a hashtag to be invalid. Which seems sensible enough. The catch: some of these changes may cause issues with the plaintext format. For which i have a proposal: What if we used goldmark to create a parser for plaintext too? It allows completely custom parsers, and we could just translate the current plaintext parsing code into a simple goldmark parser which picks out links, mentions, hashtags, linebreaks etc. using the same functions as the markdown parser. It might neaten the code and make the behavior of plaintext vs markdown more consistent. Summary of suggestions:
|
Describe the bug with a clear and concise description of what the bug is.
When posting markdown:
Won't be converted to an italicized link (only italicized). However:
Will convert all three
What's your GoToSocial Version?
v0.4.0
GoToSocial Arch
amd64 binary
What happened?
posting
_#hashtag_
doesn't convert the hashtag to a linkWhat you expected to happen?
posting
_#hashtag_
converts the hashtag to a linkHow to reproduce it?
post
_#hashtag_
with markdown formatting turned onAnything else we need to know?
No response
The text was updated successfully, but these errors were encountered: