Merge pull request #336 from ioquatix/expose-footnote-def-literal
Expose CMARK_NODE_FOOTNOTE_DEFINITION literal value.
This commit is contained in:
Коммит
c123e68e81
|
@ -1221,12 +1221,13 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container,
|
|||
depth < MAX_LIST_DEPTH &&
|
||||
(matched = scan_footnote_definition(input, parser->first_nonspace))) {
|
||||
cmark_chunk c = cmark_chunk_dup(input, parser->first_nonspace + 2, matched - 2);
|
||||
cmark_chunk_to_cstr(parser->mem, &c);
|
||||
|
||||
while (c.data[c.len - 1] != ']')
|
||||
--c.len;
|
||||
--c.len;
|
||||
|
||||
cmark_chunk_to_cstr(parser->mem, &c);
|
||||
|
||||
S_advance_offset(parser, input, parser->first_nonspace + matched - parser->offset, false);
|
||||
*container = add_child(parser, *container, CMARK_NODE_FOOTNOTE_DEFINITION, parser->first_nonspace + matched + 1);
|
||||
(*container)->as.literal = c;
|
||||
|
|
|
@ -377,6 +377,7 @@ const char *cmark_node_get_literal(cmark_node *node) {
|
|||
case CMARK_NODE_HTML_INLINE:
|
||||
case CMARK_NODE_CODE:
|
||||
case CMARK_NODE_FOOTNOTE_REFERENCE:
|
||||
case CMARK_NODE_FOOTNOTE_DEFINITION:
|
||||
return cmark_chunk_to_cstr(NODE_MEM(node), &node->as.literal);
|
||||
|
||||
case CMARK_NODE_CODE_BLOCK:
|
||||
|
|
Загрузка…
Ссылка в новой задаче