aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-11-29 09:23:10 -0800
committerJohn MacFarlane <[email protected]>2022-11-29 09:23:10 -0800
commit8f9e16265b7ca41ea171b16880b9e5fbec0ab533 (patch)
tree80a556a3beb3205c01abb5fe7eb587c9d0398251
parent07ebafcb011abda5c6a5f2d0f4d10e09417285e7 (diff)
DocBook reader: support href on link...
even in a fragment. (We now just look for an `href` attribute without worrying about the namespace.) See #8437.
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
index 6ccb3ef26..1522de628 100644
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
@@ -1277,7 +1278,10 @@ parseInline (Elem e) =
"ulink" -> innerInlines (link (attrValue "url" e) "")
"link" -> do
ils <- innerInlines id
- let href = case findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e of
+ let href = case findAttrBy
+ (\case
+ QName "href" _ _ -> True
+ _ -> False) e of
Just h -> h
_ -> "#" <> attrValue "linkend" e
let ils' = if ils == mempty then str href else ils