diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2019-10-27 22:39:32 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2019-10-27 23:00:30 +0100 |
commit | 909083090a63f65f4e720d210272c4bd6866cbee (patch) | |
tree | 688bb79eb4d18f789b39b3ad37d6828d4949a786 /src/Text/Pandoc/Readers | |
parent | bef124c98c3f2e9f9a5b1bb23c8bd8b2249a9de6 (diff) | |
download | pandoc-909083090a63f65f4e720d210272c4bd6866cbee.tar.gz |
Org reader: fix parsing of empty comment lines
Comment lines in Org-mode can be completely empty; both of these line
should produce no output:
# a comment
#
The reader used to produce a wrong result for the latter, but ignores
that line as well now.
Fixes: #5856
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Org/BlockStarts.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Org/BlockStarts.hs b/src/Text/Pandoc/Readers/Org/BlockStarts.hs index d1e13eb70..58db4f46c 100644 --- a/src/Text/Pandoc/Readers/Org/BlockStarts.hs +++ b/src/Text/Pandoc/Readers/Org/BlockStarts.hs @@ -92,7 +92,9 @@ metaLineStart :: Monad m => OrgParser m () metaLineStart = try $ skipSpaces <* string "#+" commentLineStart :: Monad m => OrgParser m () -commentLineStart = try $ skipSpaces <* string "# " +commentLineStart = try $ + -- the first char after '#' must be a plain space character or a newline + skipSpaces <* string "#" <* lookAhead (oneOf " \n") exampleLineStart :: Monad m => OrgParser m () exampleLineStart = () <$ try (skipSpaces *> string ": ") |