From 32cbb8f46d968205316c64957f9c37c9db84fce8 Mon Sep 17 00:00:00 2001 From: Mauro Bieg Date: Sat, 31 Dec 2016 04:03:43 +0100 Subject: DocBook5 writer: make id attribute xml:id, fixes #3329 (#3330) --- src/Text/Pandoc/Writers/Docbook.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text') 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 -- cgit v1.2.3