aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorMauro Bieg <mb21@users.noreply.github.com>2016-12-31 04:03:43 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-12-30 20:03:43 -0700
commit32cbb8f46d968205316c64957f9c37c9db84fce8 (patch)
tree788c43800dc426f1ac54a34aa1c7e078006ee14b /src/Text
parent9b29a55d9bdf561405bc1021011bf67d24ee0c96 (diff)
downloadpandoc-32cbb8f46d968205316c64957f9c37c9db84fce8.tar.gz
DocBook5 writer: make id attribute xml:id, fixes #3329 (#3330)
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Docbook.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs
index 5321d46df..44f96d700 100644
--- a/src/Text/Pandoc/Writers/Docbook.hs
+++ b/src/Text/Pandoc/Writers/Docbook.hs
@@ -123,7 +123,10 @@ elementToDocbook opts lvl (Sec _ _num (id',_,_) title elements) =
then "section"
else "sect" ++ show n
_ -> "simplesect"
- idAttr = [("id", writerIdentifierPrefix opts ++ id') | not (null id')]
+ idName = if writerDocbook5 opts
+ then "xml:id"
+ else "id"
+ idAttr = [(idName, writerIdentifierPrefix opts ++ id') | not (null id')]
nsAttr = if writerDocbook5 opts && lvl == 0 then [("xmlns", "http://docbook.org/ns/docbook"),("xmlns:xlink", "http://www.w3.org/1999/xlink")]
else []
attribs = nsAttr ++ idAttr