Commit 30bf5667546cdd249227817534c30ca42c3c1032

Martin Mitas 2019-03-27T02:04:49

md_is_link_destination: Use first char as an indicator... ... type of link destination we should try. If it is '<', then try only <>-styled link destination.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/md4c/md4c.c b/md4c/md4c.c
index ffb88b0..2edc9ff 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -2023,8 +2023,10 @@ static inline int
 md_is_link_destination(MD_CTX* ctx, OFF beg, OFF max_end, OFF* p_end,
                        OFF* p_contents_beg, OFF* p_contents_end)
 {
-    return (md_is_link_destination_A(ctx, beg, max_end, p_end, p_contents_beg, p_contents_end)  ||
-            md_is_link_destination_B(ctx, beg, max_end, p_end, p_contents_beg, p_contents_end));
+    if(CH(beg) == _T('<'))
+        return md_is_link_destination_A(ctx, beg, max_end, p_end, p_contents_beg, p_contents_end);
+    else
+        return md_is_link_destination_B(ctx, beg, max_end, p_end, p_contents_beg, p_contents_end);
 }
 
 static int