@@ -76,6 +76,7 @@ block = choice [ mempty <$ blanklines
7676 , list
7777 , latexFragment
7878 , noteBlock
79+ , rawOrgLine
7980 , paraOrPlain
8081 ] <?> "block"
8182
@@ -559,6 +560,8 @@ include = try $ do
559560 | otherwise -> Para content
560561 _ -> blk
561562
563+-- | Parses a meta line which defines a raw block. Currently recognized:
564+-- @#+LATEX:@, @#+HTML:@, @#+TEXINFO:@, and @#+BEAMER@.
562565rawExportLine :: PandocMonad m => OrgParser m Blocks
563566rawExportLine = try $ do
564567 metaLineStart
@@ -567,6 +570,14 @@ rawExportLine = try $ do
567570 then B.rawBlock key <$> anyLine
568571 else mzero
569572
573+-- | Parses any meta line, i.e., a line starting with @#+@, into a raw
574+-- org block. This should be the last resort when trying to parse
575+-- keywords. Leading spaces are discarded.
576+rawOrgLine :: PandocMonad m => OrgParser m (F Blocks)
577+rawOrgLine = do
578+ line <- metaLineStart *> anyLine
579+ returnF $ B.rawBlock "org" $ ("#+" <> line)
580+
570581commentLine :: Monad m => OrgParser m Blocks
571582commentLine = commentLineStart *> anyLine *> pure mempty
572583