Commit dda885e7ab4862e4e07f1f623889bbcabf50bad3

Martin Mitas 2016-10-08T21:03:10

Fix parsing of settext header underline. If indented, it is not header.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/md4c/md4c.c b/md4c/md4c.c
index c601964..831a9eb 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -1574,7 +1574,7 @@ redo_indentation_after_blockquote_mark:
     }
 
     /* Check whether we are Setext underline. */
-    if(pivot_line->type == MD_LINE_TEXT  &&  (CH(off) == _T('=') || CH(off) == _T('-'))) {
+    if(line->indent < 4  &&  pivot_line->type == MD_LINE_TEXT  &&  (CH(off) == _T('=') || CH(off) == _T('-'))) {
         if(md_is_setext_underline(ctx, off, &off) == 0) {
             line->type = MD_LINE_SETEXTUNDERLINE;
             goto done;