Skip to content

Commit

Permalink
HTML declaration doesn't require whitespace before the closer.
Browse files Browse the repository at this point in the history
Fixes #216.
  • Loading branch information
mity committed Jan 12, 2024
1 parent 7497ea9 commit 5592352
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Changes:

- HTML declaration (HTML block type 4) is not required to begin with an
upper-case ASCII character after the `<!`. Any ASCII character is now
allowed.
allowed. Also it now doesn't require a whitespace before the closing `>`.

Other than that, the newest specification mainly improves test coverage and
clarifies its wording in some cases, without affecting the implementation.
Expand Down
2 changes: 0 additions & 2 deletions src/md4c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,8 +1229,6 @@ md_is_html_declaration(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg,
off++;
while(off < lines[0].end && ISALPHA(off))
off++;
if(off < lines[0].end && !ISWHITESPACE(off))
return FALSE;

return md_scan_for_html_closer(ctx, _T(">"), 1,
lines, n_lines, off, max_end, p_end, &ctx->html_decl_horizon);
Expand Down
9 changes: 9 additions & 0 deletions test/coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,15 @@ title
````````````````````````````````


### [Issue 216](https://github.com/mity/md4c/issues/216)

```````````````````````````````` example
x <!A>
.
<p>x <!A></p>
````````````````````````````````


## Code coverage

### `md_is_unicode_whitespace__()`
Expand Down

0 comments on commit 5592352

Please sign in to comment.