summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-23 07:17:38 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-23 07:17:38 -0800
commitf28197a69d56eb0f60d5931de58cbbfbb65ee794 (patch)
treedcba5430f9e7fc6dc2f51156a2a6c3ab19cf2d61
parent1b6a4ce8ab921ddc98581abd395428e2cadd0c22 (diff)
Added internal flag to distinguish setext from atx headers.
-rw-r--r--src/blocks.c2
-rw-r--r--src/node.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/blocks.c b/src/blocks.c
index f916936..7bf4d3d 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -637,6 +637,7 @@ void cmark_process_line(cmark_doc_parser *parser, const char *buffer,
hashpos++;
}
container->as.header.level = level;
+ container->as.header.setext = false;
} else if ((matched = scan_open_code_fence(&input, first_nonspace))) {
@@ -660,6 +661,7 @@ void cmark_process_line(cmark_doc_parser *parser, const char *buffer,
container->type = NODE_HEADER;
container->as.header.level = lev;
+ container->as.header.setext = true;
offset = input.len - 1;
} else if (!(container->type == NODE_PARAGRAPH && !all_matched) &&
diff --git a/src/node.h b/src/node.h
index d1245a5..7bf6b2e 100644
--- a/src/node.h
+++ b/src/node.h
@@ -30,6 +30,7 @@ typedef struct {
typedef struct {
int level;
+ bool setext;
} cmark_header;
typedef struct {