@@ -36,7 +36,7 @@ import Data.Char (isSpace, toLower)
3636import Data.List (intersperse, isPrefixOf, stripPrefix, transpose)
3737import Data.Maybe (fromMaybe)
3838import Network.URI (isURI)
39−import Text.Pandoc.Builder (deleteMeta)
39+import qualified Text.Pandoc.Builder as B
4040import Text.Pandoc.Class (PandocMonad)
4141import Text.Pandoc.Definition
4242import Text.Pandoc.ImageSize
@@ -81,7 +81,7 @@ pandocToRST (Pandoc meta blocks) = do
8181 metadata <- metaToJSON opts
8282 (fmap (render colwidth) . blockListToRST)
8383 (fmap (trimr . render colwidth) . inlineListToRST)
84− $ deleteMeta "title" $ deleteMeta "subtitle" meta
84+ $ B.deleteMeta "title" $ B.deleteMeta "subtitle" meta
8585 body <- blockListToRST' True $ case writerTemplate opts of
8686 Just _ -> normalizeHeadings 1 blocks
8787 Nothing -> blocks
@@ -504,7 +504,7 @@ inlineToRST (Link _ [Image attr alt (imgsrc,imgtit)] (src, _tit)) = do
504504 return $ "|" <> label <> "|"
505505inlineToRST (Link _ txt (src, tit)) = do
506506 useReferenceLinks <- gets $ writerReferenceLinks . stOptions
507− linktext <- inlineListToRST $ normalizeSpaces txt
507+ linktext <- inlineListToRST $ B.toList . B.trimInlines . B.fromList $ txt
508508 if useReferenceLinks
509509 then do refs <- gets stLinks
510510 case lookup txt refs of