Org reader: allow comments above property drawer

The Org Manual page at https://orgmode.org/manual/Property-Syntax.html
says (as of 2022-02-03):

"Property blocks defined before first headline needs to be located at
the top of the buffer, allowing only comments above."

This commit allows comments above.
This commit is contained in:
Lucas V. R 2022-02-03 01:26:11 -03:00 committed by Albert Krewinkel
parent 61f4771c55
commit ae846381c3

View file

@ -41,6 +41,7 @@ documentTree :: PandocMonad m
-> OrgParser m (F Inlines)
-> OrgParser m (F Headline)
documentTree blocks inline = do
many commentLine
properties <- option mempty propertiesDrawer
initialBlocks <- blocks
headlines <- sequence <$> manyTill (headline blocks inline 1) eof
@ -59,6 +60,9 @@ documentTree blocks inline = do
, headlineContents = initialBlocks'
, headlineChildren = headlines'
}
where
commentLine :: Monad m => OrgParser m ()
commentLine = commentLineStart <* anyLine
-- | Create a tag containing the given string.
toTag :: Text -> Tag