cmark

My personal build of CMark ✏️

Commit
bd70a7a2495ae538fe9abceb907a86874cf9c8e1
Parent
065b31e17c4f5ea61aa15af8fb8af5bdecde796f
Author
John MacFarlane <jgm@berkeley.edu>
Date

Allow tabs before closing ##s in ATX header

Diffstat

1 file changed, 3 insertions, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified src/blocks.c 5 3 2
diff --git a/src/blocks.c b/src/blocks.c
@@ -564,8 +564,9 @@ static void chop_trailing_hashtags(cmark_chunk *ch)
 	while (n >= 0 && peek_at(ch, n) == '#')
 		n--;
 
-	// Check for a be a space before the final #s:
-	if (n != orig_n && n >= 0 && peek_at(ch, n) == ' ') {
+	// Check for a space before the final #s:
+	if (n != orig_n && n >= 0 &&
+	    (peek_at(ch, n) == ' ' || peek_at(ch, n) == '\t')) {
 		ch->len = n;
 		cmark_chunk_rtrim(ch);
 	}