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:
parent
61f4771c55
commit
ae846381c3
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue