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

Double closing curly braces ( }} ) seem to break the detection #52

Closed
eramdam opened this issue Apr 28, 2017 · 5 comments
Closed

Double closing curly braces ( }} ) seem to break the detection #52

eramdam opened this issue Apr 28, 2017 · 5 comments

Comments

@eramdam
Copy link

eramdam commented Apr 28, 2017

Consider this string

Here is a link https://domain.com/d/foo?email={{foo.bar}}&name={{foo.name}}

Even though curly braces are not common in URL, one would expect for https://domain.com/d/foo?email={{foo.bar}}&name={{foo.name}} to be matched to an actual link.

However linkify-it seems to stop matching after the 2nd } character in the URL, resulting in these matches:

[ Match {
    schema: 'https:',
    index: 3,
    lastIndex: 44,
    raw: 'https://domain.com/d/foo?email={{foo.bar}',
    text: 'https://domain.com/d/foo?email={{foo.bar}',
    url: 'https://domain.com/d/foo?email={{foo.bar}' },
  Match {
    schema: '',
    index: 53,
    lastIndex: 61,
    raw: 'foo.name',
    text: 'foo.name',
    url: 'http://foo.name' } ]

Notice how foo.name is being matched as another link because of that 😅

Once again, I know that { and } are not valid characters per the RFC, but Slack and other softwares correctly match this case so I guess there's something that can be done to fix that in linkify-it 😊

I'm happy to provide more details/examples.

@puzrin
Copy link
Member

puzrin commented Apr 28, 2017

Looks like dupe of #23. IMHO worth to RIP one more example there :)

@puzrin
Copy link
Member

puzrin commented Apr 28, 2017

I thinks this does not needs fix in linkify-it, but you can add kludge to your app: replace {{ and }} with something unique and non-breaking-link, and replace back after linkify run. That's dirty, but may be ok for your specific case.

@githubflub
Copy link

This is still an issue. >:[

@puzrin
Copy link
Member

puzrin commented Nov 30, 2021

@eramdam hi after many years :). I'd like to clarify status of this issue.

@puzrin
Copy link
Member

puzrin commented Apr 18, 2022

Close as dupe of #23

@puzrin puzrin closed this as completed Apr 18, 2022
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

No branches or pull requests

3 participants