Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/blocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container,

(*container)->as.heading.level = level;
(*container)->as.heading.setext = false;
(*container)->internal_offset = matched;
(*container)->as.heading.internal_offset = matched;

} else if (!indented && (matched = scan_open_code_fence(
input, parser->first_nonspace))) {
Expand Down
4 changes: 3 additions & 1 deletion src/inlines.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,9 +1381,11 @@ static int parse_inline(subject *subj, cmark_node *parent, int options) {
// Parse inlines from parent's string_content, adding as children of parent.
void cmark_parse_inlines(cmark_mem *mem, cmark_node *parent,
cmark_reference_map *refmap, int options) {
int internal_offset = parent->type == CMARK_NODE_HEADING ?
parent->as.heading.internal_offset : 0;
subject subj;
cmark_chunk content = {parent->data, parent->len};
subject_from_buf(mem, parent->start_line, parent->start_column - 1 + parent->internal_offset, &subj, &content, refmap);
subject_from_buf(mem, parent->start_line, parent->start_column - 1 + internal_offset, &subj, &content, refmap);
cmark_chunk_rtrim(&subj.input);

while (!is_eof(&subj) && parse_inline(&subj, parent, options))
Expand Down
4 changes: 2 additions & 2 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ typedef struct {
} cmark_code;

typedef struct {
int level;
int internal_offset;
int8_t level;
bool setext;
} cmark_heading;

Expand Down Expand Up @@ -69,7 +70,6 @@ struct cmark_node {
int start_column;
int end_line;
int end_column;
int internal_offset;
uint16_t type;
uint16_t flags;

Expand Down