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: url matching #1179

Merged
merged 1 commit into from
Nov 12, 2022
Merged

fix: url matching #1179

merged 1 commit into from
Nov 12, 2022

Conversation

foolo
Copy link
Contributor

@foolo foolo commented Nov 11, 2022

What does this PR do?

Fixes #771

Details:

  • Fixed ordering of matchers: URLMatcher now goes first to catch any URLs before the other matchers check for mention-tags, hashtags, etc.
  • URLMatcher now marked as "void" (which means an URL cannot contain nested tags, see https://interweave.dev/docs/matchers/#creating-a-matcher )
  • URLMatcher: when a blocked top-level-domain is found (i.e. ".lens"), set response.valid = false; This is the method in Interweave to filter out such false positives. (Before the fix, null was returned, which stopped the matcher from finding more matches, see https://interweave.dev/docs/matchers/#creating-a-matcher )

Before:
before1

After:
after1

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

Open https://lenster.xyz/posts/0x24-0xc7 and check that URL is rendered correctly (whole URL clickable, and no mention-tag inside URL)

@foolo foolo requested a review from bigint as a code owner November 11, 2022 19:33
@vercel
Copy link

vercel bot commented Nov 11, 2022

@foolo is attempting to deploy a commit to the Lenster Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Nov 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lenster ✅ Ready (Inspect) Visit Preview Nov 12, 2022 at 6:01AM (UTC)

@bigint bigint changed the title Fix url matching fix: url matching Nov 12, 2022
Copy link
Member

@bigint bigint left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

Rad LGTM

@bigint bigint enabled auto-merge (squash) November 12, 2022 06:00
@vercel vercel bot temporarily deployed to Preview November 12, 2022 06:01 Inactive
@bigint bigint merged commit cc99db3 into heyxyz:main Nov 12, 2022
@foolo foolo deleted the url-matcher branch November 12, 2022 21:29
@foolo foolo mentioned this pull request Nov 13, 2022
1 task
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.

Fix external link regex in single publication
2 participants