In md_is_atxheader_line(), set *p_end on success. This prevents reiteration over the ATX header prefix in the caller.
diff --git a/md4c/md4c.c b/md4c/md4c.c
index 0f3522e..e6b2b94 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -4803,6 +4803,7 @@ md_is_atxheader_line(MD_CTX* ctx, OFF beg, OFF* p_beg, OFF* p_end, unsigned* p_l
while(off < ctx->size && CH(off) == _T(' '))
off++;
*p_beg = off;
+ *p_end = off;
return TRUE;
}