@@ -196,7 +196,7 @@ parseRST = do
196196parseCitation :: PandocMonad m
197197 => (String, String) -> RSTParser m (Inlines, [Blocks])
198198parseCitation (ref, raw) = do
199− contents <- parseFromString parseBlocks raw
199+ contents <- parseFromString' parseBlocks raw
200200 return $ (B.spanWith (ref, ["citation-label"], []) (B.str ref),
201201 [contents])
202202
@@ -246,7 +246,7 @@ fieldListItem :: PandocMonad m => Int -> RSTParser m (Inlines, [Blocks])
246246fieldListItem minIndent = try $ do
247247 (name, raw) <- rawFieldListItem minIndent
248248 term <- parseInlineFromString name
249− contents <- parseFromString parseBlocks raw
249+ contents <- parseFromString' parseBlocks raw
250250 optional blanklines
251251 return (term, [contents])
252252
@@ -445,7 +445,7 @@ blockQuote :: PandocMonad m => RSTParser m Blocks
445445blockQuote = do
446446 raw <- indentedBlock
447447 -- parse the extracted block, which may contain various block elements:
448− contents <- parseFromString parseBlocks $ raw ++ "\n\n"
448+ contents <- parseFromString' parseBlocks $ raw ++ "\n\n"
449449 return $ B.blockQuote contents
450450
451451{-
@@ -533,7 +533,7 @@ definitionListItem = try $ do
533533 term <- trimInlines . mconcat <$> many1Till inline endline
534534 raw <- indentedBlock
535535 -- parse the extracted block, which may contain various block elements:
536− contents <- parseFromString parseBlocks $ raw ++ "\n"
536+ contents <- parseFromString' parseBlocks $ raw ++ "\n"
537537 return (term, [contents])
538538
539539definitionList :: PandocMonad m => RSTParser m Blocks
@@ -595,7 +595,7 @@ listItem start = try $ do
595595 let oldContext = stateParserContext state
596596 setState $ state {stateParserContext = ListItemState}
597597 -- parse the extracted block, which may itself contain block elements
598− parsed <- parseFromString parseBlocks $ concat (first:rest) ++ "\n"
598+ parsed <- parseFromString' parseBlocks $ concat (first:rest) ++ "\n"
599599 updateState (\st -> st {stateParserContext = oldContext})
600600 return $ case B.toList parsed of
601601 [Para xs] ->
@@ -686,19 +686,19 @@ directive' = do
686686 "line-block" -> lineBlockDirective body'
687687 "raw" -> return $ B.rawBlock (trim top) (stripTrailingNewlines body)
688688 "role" -> addNewRole top $ map (\(k,v) -> (k, trim v)) fields
689− "container" -> parseFromString parseBlocks body'
689+ "container" -> parseFromString' parseBlocks body'
690690 "replace" -> B.para <$> -- consumed by substKey
691691 parseInlineFromString (trim top)
692692 "unicode" -> B.para <$> -- consumed by substKey
693693 parseInlineFromString (trim $ unicodeTransform top)
694− "compound" -> parseFromString parseBlocks body'
695− "pull-quote" -> B.blockQuote <$> parseFromString parseBlocks body'
696− "epigraph" -> B.blockQuote <$> parseFromString parseBlocks body'
697− "highlights" -> B.blockQuote <$> parseFromString parseBlocks body'
694+ "compound" -> parseFromString' parseBlocks body'
695+ "pull-quote" -> B.blockQuote <$> parseFromString' parseBlocks body'
696+ "epigraph" -> B.blockQuote <$> parseFromString' parseBlocks body'
697+ "highlights" -> B.blockQuote <$> parseFromString' parseBlocks body'
698698 "rubric" -> B.para . B.strong <$> parseInlineFromString top
699699 _ | label `elem` ["attention","caution","danger","error","hint",
700700 "important","note","tip","warning","admonition"] ->
701− do bod <- parseFromString parseBlocks $ top ++ "\n\n" ++ body'
701+ do bod <- parseFromString' parseBlocks $ top ++ "\n\n" ++ body'
702702 let lab = case label of
703703 "admonition" -> mempty
704704 (l:ls) -> B.divWith ("",["admonition-title"],[])
@@ -711,11 +711,11 @@ directive' = do
711711 (trim top ++ if null subtit
712712 then ""
713713 else (": " ++ subtit))
714− bod <- parseFromString parseBlocks body'
714+ bod <- parseFromString' parseBlocks body'
715715 return $ B.divWith ("",["sidebar"],[]) $ tit <> bod
716716 "topic" ->
717717 do tit <- B.para . B.strong <$> parseInlineFromString top
718− bod <- parseFromString parseBlocks body'
718+ bod <- parseFromString' parseBlocks body'
719719 return $ B.divWith ("",["topic"],[]) $ tit <> bod
720720 "default-role" -> mempty <$ updateState (\s ->
721721 s { stateRstDefaultRole =
@@ -731,7 +731,7 @@ directive' = do
731731 "math" -> return $ B.para $ mconcat $ map B.displayMath
732732 $ toChunks $ top ++ "\n\n" ++ body
733733 "figure" -> do
734− (caption, legend) <- parseFromString extractCaption body'
734+ (caption, legend) <- parseFromString' extractCaption body'
735735 let src = escapeURI $ trim top
736736 return $ B.para (B.imageWith (imgAttr "figclass") src "fig:"
737737 caption) <> legend
@@ -750,21 +750,21 @@ directive' = do
750750 -- directive content or the first immediately following element
751751 children <- case body of
752752 "" -> block
753− _ -> parseFromString parseBlocks body'
753+ _ -> parseFromString' parseBlocks body'
754754 return $ B.divWith attrs children
755755 other -> do
756756 pos <- getPosition
757757 logMessage $ SkippedContent (".. " ++ other) pos
758− bod <- parseFromString parseBlocks $ top ++ "\n\n" ++ body'
758+ bod <- parseFromString' parseBlocks $ top ++ "\n\n" ++ body'
759759 return $ B.divWith ("",[other],[]) bod
760760
761761tableDirective :: PandocMonad m
762762 => String -> [(String, String)] -> String -> RSTParser m Blocks
763763tableDirective top _fields body = do
764− bs <- parseFromString parseBlocks body
764+ bs <- parseFromString' parseBlocks body
765765 case B.toList bs of
766766 [Table _ aligns' widths' header' rows'] -> do
767− title <- parseFromString (trimInlines . mconcat <$> many inline) top
767+ title <- parseFromString' (trimInlines . mconcat <$> many inline) top
768768 -- TODO widths
769769 -- align is not applicable since we can't represent whole table align
770770 return $ B.singleton $ Table (B.toList title)
@@ -780,8 +780,8 @@ listTableDirective :: PandocMonad m
780780 => String -> [(String, String)] -> String
781781 -> RSTParser m Blocks
782782listTableDirective top fields body = do
783− bs <- parseFromString parseBlocks body
784− title <- parseFromString (trimInlines . mconcat <$> many inline) top
783+ bs <- parseFromString' parseBlocks body
784+ title <- parseFromString' (trimInlines . mconcat <$> many inline) top
785785 let rows = takeRows $ B.toList bs
786786 headerRowsNum = fromMaybe (0 :: Int) $
787787 lookup "header-rows" fields >>= safeRead
@@ -812,7 +812,7 @@ addNewRole :: PandocMonad m
812812 => String -> [(String, String)] -> RSTParser m Blocks
813813addNewRole roleString fields = do
814814 pos <- getPosition
815− (role, parentRole) <- parseFromString inheritedRole roleString
815+ (role, parentRole) <- parseFromString' inheritedRole roleString
816816 customRoles <- stateRstCustomRoles <$> getState
817817 let getBaseRole (r, f, a) roles =
818818 case M.lookup r roles of
@@ -1127,7 +1127,7 @@ simpleTableRow indices = do
11271127 let cols = map unlines . transpose $ firstLine : conLines ++
11281128 [replicate (length indices) ""
11291129 | not (null conLines)]
1130− mapM (parseFromString parseBlocks) cols
1130+ mapM (parseFromString' parseBlocks) cols
11311131
11321132simpleTableSplitLine :: [Int] -> String -> [String]
11331133simpleTableSplitLine indices line =
@@ -1150,7 +1150,7 @@ simpleTableHeader headless = try $ do
11501150 let rawHeads = if headless
11511151 then replicate (length dashes) ""
11521152 else simpleTableSplitLine indices rawContent
1153− heads <- mapM (parseFromString (mconcat <$> many plain)) $
1153+ heads <- mapM (parseFromString' (mconcat <$> many plain)) $
11541154 map trim rawHeads
11551155 return (heads, aligns, indices)
11561156
@@ -1206,7 +1206,7 @@ inline = choice [ note -- can start with whitespace, so try before ws
12061206 , symbol ] <?> "inline"
12071207
12081208parseInlineFromString :: PandocMonad m => String -> RSTParser m Inlines
1209−parseInlineFromString = parseFromString (trimInlines . mconcat <$> many inline)
1209+parseInlineFromString = parseFromString' (trimInlines . mconcat <$> many inline)
12101210
12111211hyphens :: Monad m => RSTParser m Inlines
12121212hyphens = do
@@ -1470,7 +1470,7 @@ note = try $ do
14701470 -- Note references inside other notes are allowed in reST, but
14711471 -- not yet in this implementation.
14721472 updateState $ \st -> st{ stateNotes = [] }
1473− contents <- parseFromString parseBlocks raw
1473+ contents <- parseFromString' parseBlocks raw
14741474 let newnotes = if (ref == "*" || ref == "#") -- auto-numbered
14751475 -- delete the note so the next auto-numbered note
14761476 -- doesn't get the same contents: