@@ -36,7 +36,7 @@ import Data.Char (isSpace, toLower)
36import Data.List (intersperse, isPrefixOf, stripPrefix, transpose)
36import Data.List (intersperse, isPrefixOf, stripPrefix, transpose)
37import Data.Maybe (fromMaybe)
37import Data.Maybe (fromMaybe)
38import Network.URI (isURI)
38import Network.URI (isURI)
39−import Text.Pandoc.Builder (deleteMeta)
39+import qualified Text.Pandoc.Builder as B
40import Text.Pandoc.Class (PandocMonad)
40import Text.Pandoc.Class (PandocMonad)
41import Text.Pandoc.Definition
41import Text.Pandoc.Definition
42import Text.Pandoc.ImageSize
42import Text.Pandoc.ImageSize
@@ -81,7 +81,7 @@ pandocToRST (Pandoc meta blocks) = do
81 metadata <- metaToJSON opts
81 metadata <- metaToJSON opts
82 (fmap (render colwidth) . blockListToRST)
82 (fmap (render colwidth) . blockListToRST)
83 (fmap (trimr . render colwidth) . inlineListToRST)
83 (fmap (trimr . render colwidth) . inlineListToRST)
84− $ deleteMeta "title" $ deleteMeta "subtitle" meta
84+ $ B.deleteMeta "title" $ B.deleteMeta "subtitle" meta
85 body <- blockListToRST' True $ case writerTemplate opts of
85 body <- blockListToRST' True $ case writerTemplate opts of
86 Just _ -> normalizeHeadings 1 blocks
86 Just _ -> normalizeHeadings 1 blocks
87 Nothing -> blocks
87 Nothing -> blocks
@@ -504,7 +504,7 @@ inlineToRST (Link _ [Image attr alt (imgsrc,imgtit)] (src, _tit)) = do
504 return $ "|" <> label <> "|"
504 return $ "|" <> label <> "|"
505inlineToRST (Link _ txt (src, tit)) = do
505inlineToRST (Link _ txt (src, tit)) = do
506 useReferenceLinks <- gets $ writerReferenceLinks . stOptions
506 useReferenceLinks <- gets $ writerReferenceLinks . stOptions
507− linktext <- inlineListToRST $ normalizeSpaces txt
507+ linktext <- inlineListToRST $ B.toList . B.trimInlines . B.fromList $ txt
508 if useReferenceLinks
508 if useReferenceLinks
509 then do refs <- gets stLinks
509 then do refs <- gets stLinks
510 case lookup txt refs of
510 case lookup txt refs of