Skip to content

Commit 17169ab

Browse files
waldyriousAshe Connor
authored andcommitted
Specify parenthesis matching in autolink extension (commonmark#148)
Also add two more examples to illustrate the behavior
1 parent 4a7985e commit 17169ab

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/spec.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9242,16 +9242,22 @@ Visit www.commonmark.org/a.b.
92429242

92439243
When an autolink ends in `)`, we scan the entire autolink for the total number
92449244
of parentheses. If there is a greater number of closing parentheses than
9245-
opening ones, we don't consider the last character part of the autolink, in
9246-
order to facilitate including an autolink inside a parenthesis:
9245+
opening ones, we don't consider the unmatched trailing parentheses part of the
9246+
autolink, in order to facilitate including an autolink inside a parenthesis:
92479247

92489248
```````````````````````````````` example autolink
92499249
www.google.com/search?q=Markup+(business)
92509250

9251+
www.google.com/search?q=Markup+(business)))
9252+
92519253
(www.google.com/search?q=Markup+(business))
9254+
9255+
(www.google.com/search?q=Markup+(business)
92529256
.
92539257
<p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p>
9258+
<p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>))</p>
92549259
<p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>)</p>
9260+
<p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p>
92559261
````````````````````````````````
92569262

92579263
This check is only done when the link ends in a closing parentheses `)`, so if

0 commit comments

Comments
 (0)