Commit b2ee4b194c82f8b24f9ea3e575f6b7b8d5de8567

Martin Mitas 2021-04-14T18:27:19

md_resolve_links: Fix the test for the nested autolink covering whole link text. This fixes the fix for #152.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/md4c.c b/src/md4c.c
index 7ed80b6..6aeef11 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -3630,7 +3630,8 @@ md_resolve_links(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
                 if((first_nested->flags & MD_MARK_RESOLVED)  &&
                    first_nested->beg == opener->end  &&
                    ISANYOF_(first_nested->ch, _T("@:."))  &&
-                   first_nested->next == (last_nested - ctx->marks))
+                   first_nested->next == (last_nested - ctx->marks)  &&
+                   last_nested->end == closer->beg)
                 {
                     first_nested->ch = _T('D');
                     first_nested->flags &= ~MD_MARK_RESOLVED;