summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-16 13:12:27 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-16 13:12:27 -0700
commitbd70a7a2495ae538fe9abceb907a86874cf9c8e1 (patch)
treea031c9bc34c244bd35846c9bfc1c4cc98d2852c9 /src/blocks.c
parent065b31e17c4f5ea61aa15af8fb8af5bdecde796f (diff)
Allow tabs before closing ##s in ATX header
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c5
1 files changed, 3 insertions, 2 deletions
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);
}