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

Better handle nested parens #23

Open
puzrin opened this issue Sep 8, 2015 · 4 comments
Open

Better handle nested parens #23

puzrin opened this issue Sep 8, 2015 · 4 comments

Comments

@puzrin
Copy link
Member

puzrin commented Sep 8, 2015

As discussed in #22.

Examples:

  • http://example.com/render?target=summarize(deriviative(app.numUsers),%221min%22)&title=New_Users_Per_Minute, from Graphite
  • http://sv-t-vnl-forge-metrics:5601/?#/dashboard/Logs-Marmotte?_a=(filters:!(),panels:!((col:1,columns:!(message,host,tags),id:Marmotte-logs,row:1,size_x:12,size_y:8,sort:!('@timestamp',asc),type:search)),query:(query_string:(analyze_wildcard:!t,query:'*')),title:'Logs%20Marmotte')&_g=(refreshInterval:(display:'10%20seconds',pause:!f,section:1,value:10000),time:(from:now-15m,mode:quick,to:now)), generated by the "share" link of Kibana 4.

Considerations:

  1. first implementation of Handle nested parens #22 was rejected due ignoring rules between scoped pairs: (foo)ignored---content(bar)
  2. Need to limit max nesting level (2-3 max).

Note. This issue is not critical for markdown-it. Improvment left to volunteers help.

@x9t9
Copy link

x9t9 commented May 10, 2017

@puzrin I believe that this issue is important for markdown-it .
In fact, not knowing that this is the underlying library - I had opened an issue there . ( sorry.. ?? )
Similar problem ( and potentially more serious because of validity of character ) also occurs with the closing parenthesis character ")" .
Should I open another issue in this repository ?

@puzrin
Copy link
Member Author

puzrin commented May 10, 2017

Your case is not related to this issue anyhow. Unpaired closing scope can not be guessed as been or not been part of URL with 100% guarantee. In most of cases - it will not.

@puzrin
Copy link
Member Author

puzrin commented May 18, 2020

#79

More samples with nested scopes.

@thisisamir98
Copy link

thisisamir98 commented Feb 13, 2023

Hi, we are having this issue as well.
Given this URL https://example.com/teams/{{teamid}}/info after reading your source code I figured out that in the validate method
passed -> //example.com/teams/{{teamid}}/info
matched -> //example.com/teams/{{teamid}

and the issue might be in the regex matching at:
https://github.com/markdown-it/linkify-it/blob/master/lib/re.js#L57

changing this line from

'\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +

to

'\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}}|' +

fixes the issue for us but breaks matching of single curly braces.

image

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