diff options
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index ca59cc1af..0dfb3c856 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -861,10 +861,13 @@ parseInline (Elem e) = $ code $ strContent e "uri" -> return $ link (strContent e) "" $ code $ strContent e "ulink" -> link (attrValue "url" e) "" <$> innerInlines - "link" -> case findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e of - Just href -> link href "" <$> innerInlines - _ -> link ('#' : attrValue "linkend" e) "" - <$> innerInlines + "link" -> do + ils <- innerInlines + let href = case findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e of + Just h -> h + _ -> ('#' : attrValue "linkend" e) + let ils' = if ils == mempty then code href else ils + return $ link href "" ils' "foreignphrase" -> emph <$> innerInlines "emphasis" -> case attrValue "role" e of "strong" -> strong <$> innerInlines |