From bd70a7a2495ae538fe9abceb907a86874cf9c8e1 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Thu, 16 Jul 2015 13:12:27 -0700
Subject: Allow tabs before closing ##s in ATX header

---
 src/blocks.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/blocks.c b/src/blocks.c
index f8b7495..8828a11 100644
--- 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);
 	}
-- 
cgit v1.2.3