Allow tabs after setext header underline. Fixes #215.
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 47 48 49 50 51
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e7629c..17fabe1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -98,6 +98,10 @@ Fixes:
* [#214](https://github.com/mity/md4c/issues/214):
Tags `<h2>` ... `<h6>` incorrectly did not trigger HTML block.
+ * [#215](https://github.com/mity/md4c/issues/215):
+ The parser incorrectly did not accept optional tabs after setext header
+ underline.
+
## Version 0.4.8
diff --git a/src/md4c.c b/src/md4c.c
index 15e9bd2..4842ed9 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -5216,8 +5216,8 @@ md_is_setext_underline(MD_CTX* ctx, OFF beg, OFF* p_end, unsigned* p_level)
while(off < ctx->size && CH(off) == CH(beg))
off++;
- /* Optionally, space(s) can follow. */
- while(off < ctx->size && CH(off) == _T(' '))
+ /* Optionally, space(s) or tabs can follow. */
+ while(off < ctx->size && ISBLANK(off))
off++;
/* But nothing more is allowed on the line. */
diff --git a/test/coverage.txt b/test/coverage.txt
index 27e35dd..9970e5f 100644
--- a/test/coverage.txt
+++ b/test/coverage.txt
@@ -401,6 +401,16 @@ _bar_
````````````````````````````````
+### [Issue 215](https://github.com/mity/md4c/issues/215)
+
+```````````````````````````````` example
+title
+--→
+.
+<h2>title</h2>
+````````````````````````````````
+
+
## Code coverage
### `md_is_unicode_whitespace__()`