HTML declaration doesn't require whitespace before the closer. Fixes #216.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 17fabe1..bc93ee4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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.
diff --git a/src/md4c.c b/src/md4c.c
index 4842ed9..e25d266 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -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);
diff --git a/test/coverage.txt b/test/coverage.txt
index 9970e5f..1d4fdf5 100644
--- a/test/coverage.txt
+++ b/test/coverage.txt
@@ -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__()`