Skip to content

Commit

Permalink
Update HTML comment scanner...
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Sep 8, 2022
1 parent 9c1922e commit 3dfe48d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/inlines.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,9 +908,9 @@ static cmark_node *handle_pointy_brace(subject *subj, int options) {
if (c == '!') {
c = subj->input.data[subj->pos+1];
if (c == '-') {
matchlen = scan_html_comment(&subj->input, subj->pos + 2);
matchlen = scan_html_comment(&subj->input, subj->pos + 1);
if (matchlen > 0)
matchlen += 2; // prefix "<-"
matchlen += 1; // prefix "<!"
} else if (c == '[') {
if ((subj->flags & FLAG_SKIP_HTML_CDATA) == 0) {
matchlen = scan_html_cdata(&subj->input, subj->pos + 2);
Expand Down
2 changes: 1 addition & 1 deletion src/scanners.re
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bufsize_t _scan_at(bufsize_t (*scanner)(const unsigned char *), cmark_chunk *c,
opentag = tagname attribute* spacechar* [/]? [>];
closetag = [/] tagname spacechar* [>];
htmlcomment = "--->" | ("-" ([-]? [^\x00>-]) ([-]? [^\x00-])* "-->");
htmlcomment = "-->" | "--->" | "--" ([^\x00-]+ | "-" [^\x00-] | "--" [^\x00>])+ "-->";
processinginstruction = ([^?>\x00]+ | [?][^>\x00] | [>])+;
Expand Down

0 comments on commit 3dfe48d

Please sign in to comment.