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

[bug] Mentions/hashtags in markdown show up in metadata even in code blocks #1271

Closed
autumnull opened this issue Dec 16, 2022 · 5 comments · Fixed by #1406
Closed

[bug] Mentions/hashtags in markdown show up in metadata even in code blocks #1271

autumnull opened this issue Dec 16, 2022 · 5 comments · Fixed by #1406
Labels
bug Something isn't working

Comments

@autumnull
Copy link
Contributor

Describe the bug with a clear and concise description of what the bug is.

In markdown mode, mentions and hashtags that don't render as clickable tags (e.g. in code blocks), are included in the tags and mentions metadata of the post.

What's your GoToSocial Version?

v0.6.0

GoToSocial Arch

armv7 Binary

Browser version

No response

What happened?

Make a post like this:

How to mention a user
```
@user@floss.dude.io hey bud! nice #ObjectOrientedProgramming software you've been writing lately!
```
hope that helps

and the user tagged in the code block will be included in the mentions field of the status, as well as the hashtag being included in the tags field.

What you expected to happen?

Neither the user nor the hashtag should be associated with the post metadata.

How to reproduce it?

Make post as above.

Anything else we need to know?

This is because the hashtags and mentions are scanned from the post before it is rendered as markdown. They should probably be scanned afterward, or during the markdown parsing process somehow.

@autumnull autumnull added the bug Something isn't working label Dec 16, 2022
@tsmethurst tsmethurst added this to the v0.7.0 Stormy Sloth milestone Dec 16, 2022
@tsmethurst
Copy link
Contributor

@autumnull is this still a thing? just checking through issues

@autumnull
Copy link
Contributor Author

@tsmethurst probably? unless anyone's significantly overhauled the status text processing part in the meantime, i haven't been paying close attention

@autumnull
Copy link
Contributor Author

the issue was that statuses were scanned with a regex for tags and mentions, rather than taking into account their context in markdown which might make them not actually mentions

@tsmethurst
Copy link
Contributor

Aha okay thank you! <3

@autumnull
Copy link
Contributor Author

Update: This also applies to emojis :face_with_spiral_eyes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants