From a9da6782761e4d3ac7dfd3193fa43b73824afef4 Mon Sep 17 00:00:00 2001 From: Yuki Izumi Date: Thu, 1 Dec 2016 20:52:42 +1100 Subject: Allow balanced nested parens in link destinations (#166) --- test/spec.txt | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'test') diff --git a/test/spec.txt b/test/spec.txt index c66f93b..c49e85b 100644 --- a/test/spec.txt +++ b/test/spec.txt @@ -7148,8 +7148,7 @@ A [link destination](@) consists of either - a nonempty sequence of characters that does not include ASCII space or control characters, and includes parentheses only if (a) they are backslash-escaped or (b) they are part of - a balanced pair of unescaped parentheses that is not itself - inside a balanced pair of unescaped parentheses. + a balanced pair of unescaped parentheses. A [link title](@) consists of either @@ -7255,35 +7254,29 @@ Parentheses inside the link destination may be escaped:

link

```````````````````````````````` -One level of balanced parentheses is allowed without escaping: - -```````````````````````````````` example -[link]((foo)and(bar)) -. -

link

-```````````````````````````````` - -However, if you have parentheses within parentheses, you need to escape -or use the `<...>` form: +Any number parentheses are allowed without escaping, as long as they are +balanced: ```````````````````````````````` example [link](foo(and(bar))) . -

[link](foo(and(bar)))

+

link

```````````````````````````````` +However, if you have unbalanced parentheses, you need to escape or use the +`<...>` form: ```````````````````````````````` example -[link](foo(and\(bar\))) +[link](foo\(and\(bar\)) . -

link

+

link

```````````````````````````````` ```````````````````````````````` example -[link]() +[link]() . -

link

+

link

```````````````````````````````` -- cgit v1.2.3