Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix links not working when exclamation mark before it#802

Merged
dessalines merged 3 commits into
LemmyNet:mainfrom
MV-GH:bug/795
Jun 21, 2023
Merged

Fix links not working when exclamation mark before it#802
dessalines merged 3 commits into
LemmyNet:mainfrom
MV-GH:bug/795

Conversation

@MV-GH

@MV-GH MV-GH commented Jun 21, 2023

Copy link
Copy Markdown
Collaborator

It didnt work in some cases because it included the space, in the current link matcher.
image

(?:^|\\s)!($communityPatternFragment)(?:@($instancePatternFragment))?\\b
This pattern used a non capturing group, but this is still included in the matched string thus it added the space, instead I used a lookbehind since these aren't included in the matched string. Also I updated the tests to include this edge case.

Fixes #795

@dessalines dessalines left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@dessalines dessalines enabled auto-merge (squash) June 21, 2023 20:05
@dessalines dessalines merged commit d4c42bc into LemmyNet:main Jun 21, 2023
@MV-GH MV-GH deleted the bug/795 branch June 21, 2023 21:39
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.

!community@instance is not clickable if has a exclamation mark before it.

2 participants