diff options
author | mpickering <matthewtpickering@gmail.com> | 2014-08-20 18:11:37 +0100 |
---|---|---|
committer | mpickering <matthewtpickering@gmail.com> | 2014-08-20 18:11:37 +0100 |
commit | 2cd049a1bf66f486e7110449854ceb253268fff7 (patch) | |
tree | 0e0dfc9ff828c6b290af219a514b6e25252c6623 /src/Text/Pandoc/Readers | |
parent | 27ea34489a8385701d3245cac10e21df6b59fbcf (diff) | |
download | pandoc-2cd049a1bf66f486e7110449854ceb253268fff7.tar.gz |
Txt2Tags reader: Header is now parsed only if standalone flag is set
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Txt2Tags.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs index 3a51b9d84..dc221568c 100644 --- a/src/Text/Pandoc/Readers/Txt2Tags.hs +++ b/src/Text/Pandoc/Readers/Txt2Tags.hs @@ -91,7 +91,10 @@ readTxt2TagsNoMacros = readTxt2Tags def parseT2T :: T2T Pandoc parseT2T = do - _ <- (Nothing <$ try blankline) <|> (Just <$> (count 3 anyLine)) + -- Parse header if standalone flag is set + optional ((readerStandalone . stateOptions <$> getState) + >>= guard + >> (() <$ (try blankline) <|> () <$ (count 3 anyLine))) config <- manyTill setting (notFollowedBy setting) -- TODO: Handle settings better let settings = foldr (\(k,v) -> B.setMeta k (MetaString v)) nullMeta config |