Commit ba29d0075eb54cfa8ceee10a0d193fef96a0e674

Martin Mitas 2016-12-12T23:31:59

md_is_link_reference_definition: Fix handling of multiline label (issue #9).

diff --git a/md4c/md4c.c b/md4c/md4c.c
index aae2a63..55ed672 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -1598,7 +1598,7 @@ md_is_link_reference_definition(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
     ctx->n_link_ref_defs++;
     memset(def, 0, sizeof(MD_LINK_REF_DEF));
 
-    if(label_is_multiline) {
+    if(!label_is_multiline) {
         def->label = (CHAR*) STR(label_contents_beg);
         def->label_size = label_contents_end - label_contents_beg;
     } else {
diff --git a/test/coverage.txt b/test/coverage.txt
index e575e98..e092048 100644
--- a/test/coverage.txt
+++ b/test/coverage.txt
@@ -48,3 +48,18 @@ att2=tok2> bar</p>
 .
 <p><img src="img.png" alt="alt text with entity ©" title="title"></p>
 ````````````````````````````````
+
+
+### [Issue 9](https://github.com/mity/md4c/issues/9)
+
+```````````````````````````````` example
+> [foo
+> bar]: /url
+>
+> [foo bar]
+.
+<blockquote>
+<p><a href="/url">foo
+bar</a></p>
+</blockquote>
+````````````````````````````````