Skip to content

Commit c123e68

Browse files
authored
Merge pull request #336 from ioquatix/expose-footnote-def-literal
Expose CMARK_NODE_FOOTNOTE_DEFINITION literal value.
2 parents 049a6e3 + 85d2eb9 commit c123e68

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/blocks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,12 +1221,13 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container,
12211221
depth < MAX_LIST_DEPTH &&
12221222
(matched = scan_footnote_definition(input, parser->first_nonspace))) {
12231223
cmark_chunk c = cmark_chunk_dup(input, parser->first_nonspace + 2, matched - 2);
1224-
cmark_chunk_to_cstr(parser->mem, &c);
12251224

12261225
while (c.data[c.len - 1] != ']')
12271226
--c.len;
12281227
--c.len;
12291228

1229+
cmark_chunk_to_cstr(parser->mem, &c);
1230+
12301231
S_advance_offset(parser, input, parser->first_nonspace + matched - parser->offset, false);
12311232
*container = add_child(parser, *container, CMARK_NODE_FOOTNOTE_DEFINITION, parser->first_nonspace + matched + 1);
12321233
(*container)->as.literal = c;

src/node.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ const char *cmark_node_get_literal(cmark_node *node) {
377377
case CMARK_NODE_HTML_INLINE:
378378
case CMARK_NODE_CODE:
379379
case CMARK_NODE_FOOTNOTE_REFERENCE:
380+
case CMARK_NODE_FOOTNOTE_DEFINITION:
380381
return cmark_chunk_to_cstr(NODE_MEM(node), &node->as.literal);
381382

382383
case CMARK_NODE_CODE_BLOCK:

0 commit comments

Comments
 (0)