summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-10-31 22:10:45 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-10-31 22:10:45 -0700
commit601908591b553b87901bb1122ff4e29d1decd6b1 (patch)
treea69ad063e0e5d0db8b5d99b6389a202188a8f3de /src/blocks.c
parentb14ece9e725175f98011dda8749d046d25b2f2bb (diff)
parent45ca1bc3867a48c75a6c464cf2420e25a8ef74c6 (diff)
Merge branch 'master' into cmake
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/blocks.c b/src/blocks.c
index ae106d2..7613c82 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -432,15 +432,15 @@ static void chop_trailing_hashtags(chunk *ch)
chunk_rtrim(ch);
orig_n = n = ch->len - 1;
- // if string ends in #s, remove these:
+ // if string ends in space followed by #s, remove these:
while (n >= 0 && peek_at(ch, n) == '#')
n--;
- // the last # was escaped, so we include it.
- if (n != orig_n && n >= 0 && peek_at(ch, n) == '\\')
- n++;
-
- ch->len = n + 1;
+ // Check for a be a space before the final #s:
+ if (n != orig_n && n >= 0 && peek_at(ch, n) == ' ') {
+ ch->len = n;
+ chunk_rtrim(ch);
+ }
}
// Process one line at a time, modifying a node_block.