diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-08-22 12:16:57 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-08-22 12:43:15 +0300 |
commit | 937b92cd304a6a404f750c7f9a894adfb3638d01 (patch) | |
tree | fa55798ebb125f5a1bc97e4bda92d30ddc18fec4 /src/Text | |
parent | 3b5949e8f278a8d407777f567fdaf8e421323ced (diff) | |
download | pandoc-937b92cd304a6a404f750c7f9a894adfb3638d01.tar.gz |
HTML reader: extract spaces inside links instead of trimming them
Fixes #4845
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index df8dc1a2d..697ab89e9 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -745,18 +745,18 @@ pLink = try $ do let uid = fromMaybe (T.unpack $ fromAttrib "name" tag) $ maybeFromAttrib "id" tag let cls = words $ T.unpack $ fromAttrib "class" tag - lab <- trimInlines . mconcat <$> manyTill inline (pCloses "a") + lab <- mconcat <$> manyTill inline (pCloses "a") -- check for href; if href, then a link, otherwise a span case maybeFromAttrib "href" tag of Nothing -> - return $ B.spanWith (uid, cls, []) lab + return $ extractSpaces (B.spanWith (uid, cls, [])) lab Just url' -> do mbBaseHref <- baseHref <$> getState let url = case (parseURIReference url', mbBaseHref) of (Just rel, Just bs) -> show (rel `nonStrictRelativeTo` bs) _ -> url' - return $ B.linkWith (uid, cls, []) (escapeURI url) title lab + return $ extractSpaces (B.linkWith (uid, cls, []) (escapeURI url) title) lab pImage :: PandocMonad m => TagParser m Inlines pImage = do |