Skip to content
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

Fix mentions, hashtags and custom emojis being formatted with Markdown #2433

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Plastikmensch
Copy link

@Plastikmensch Plastikmensch commented Oct 6, 2023

Fixes #2432

Not the best solution, but the easiest I could think of not requiring a major refactor.
This will force escape underscores in mentions, hashtags and custom emojis.

This will still not link correctly when content type is html, but I consider that a separate issue.
(Mentions and hashtags don't get displayed as such, but still work)

app/lib/advanced_text_formatter.rb Fixed Show resolved Hide resolved
@Plastikmensch Plastikmensch marked this pull request as ready for review October 6, 2023 20:47
@MagicLike
Copy link

Would it be possible to also adjust this for custom emojis?

#2432 (comment)

Prevents usernames with underscores being formatted with underline.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
Test that usernames with underscores get linked correctly

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
Prevents custom emojis and hashtags from being underlined and therefore broken.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
Test for hashtags with underscores.

Custom emojis are not tested for in this file and I'm not sure how best to add that.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
@Plastikmensch Plastikmensch force-pushed the fix-mentions-being-formatted-to-markdown branch from 5930fb7 to d1acc6e Compare November 25, 2024 15:21
@Plastikmensch Plastikmensch changed the title Fix mentions being formatted with Markdown Fix mentions, hashtags and custom emojis being formatted with Markdown Nov 25, 2024
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.

Mentions gets rewritten as markdown
3 participants