Skip to content

Commit

Permalink
Add nested parens support, closes markdown-it#23
Browse files Browse the repository at this point in the history
  • Loading branch information
torifat committed Sep 22, 2017
1 parent cbc0833 commit 0382e8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/re.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function (opts) {
'(?:' +
'(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
'\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
'\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
'\\(((?:(?!' + re.src_ZCc + '|[())]).)*|(\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)))*\\)|' +
'\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
'\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
"\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
Expand Down
10 changes: 10 additions & 0 deletions test/fixtures/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,16 @@ http://ﻡﻮﻘﻋ.ﻭﺯﺍﺭﺓ-ﺍﻼﺘﺻﺍﻼﺗ.ﻢﺻﺭ/

http://xn--4gbrim.xn----ymcbaaajlc6dj7bxne2c.xn--wgbh1c/


% some urls have nested parens
http://example.com/render?target=summarize(deriviative(app.numUsers),%221min%22)&title=New_Users_Per_Minute

http://example.com/foo-(with-nested-(parens)).
http://example.com/foo-(with-nested-(parens))

http://example.com/(foo) (bar)
http://example.com/(foo)

%
% Others...
%
Expand Down

0 comments on commit 0382e8d

Please sign in to comment.