Skip to content

Commit

Permalink
Syntaxhighlight extension ignore math fenced code block.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbarex committed Apr 14, 2023
1 parent fefede0 commit 2c0a2f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmark-extra/extensions/syntaxhighlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ static cmark_node *postprocess(cmark_syntax_extension *ext, cmark_parser *parser
// type = node->type;

if (ev == CMARK_EVENT_ENTER && node->type == CMARK_NODE_CODE_BLOCK) {
cmark_node_set_syntax_extension(node, ext);
if (strcmp((const char *)node->as.code.info.data, "math") == 0) {
// Do not process, require the Math extension.
} else {
cmark_node_set_syntax_extension(node, ext);
}
}

if (in_code) {
Expand Down

0 comments on commit 2c0a2f4

Please sign in to comment.