diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-11-19 10:30:20 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-11-19 10:30:20 +0100 |
commit | e4798a6726e417decb959c86dae7545ab6c8522d (patch) | |
tree | 8b53191aade4cd35460ef5d9f4ab893e8d9dcc78 /src/Text/Pandoc/Readers | |
parent | 1a8af5fc442287ef2f7775c4de179e4520487a4f (diff) | |
download | pandoc-e4798a6726e417decb959c86dae7545ab6c8522d.tar.gz |
Fixed xref lookup in DocBook reader. Closes #3243.
It previously only worked when the qnames lacked the docbook
namespace URI.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 4d8d5ab94..68552ccb3 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -964,9 +964,11 @@ parseInline (Elem e) = content <- dbContent <$> get let linkend = attrValue "linkend" e let title = case attrValue "endterm" e of - "" -> maybe "???" xrefTitleByElem (findElementById linkend content) - endterm -> maybe "???" strContent (findElementById endterm content) - return $ link ('#' : linkend) "" (singleton (Str title)) + "" -> maybe "???" xrefTitleByElem + (findElementById linkend content) + endterm -> maybe "???" strContent + (findElementById endterm content) + return $ link ('#' : linkend) "" (text title) "email" -> return $ link ("mailto:" ++ strContent e) "" $ str $ strContent e "uri" -> return $ link (strContent e) "" $ str $ strContent e @@ -1050,4 +1052,4 @@ parseInline (Elem e) = where xrefLabel = attrValue "xreflabel" el descendantContent name = maybe "???" strContent - . findElement (QName name Nothing Nothing) + . filterElementName (\n -> qName n == name) |