summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-02-25 06:59:43 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-02-25 06:59:43 -0800
commitae3142f919a29900c8d53e486e02d40125b5a542 (patch)
treeac6abdf62a19091f60a79eb30c97277709d38287 /src/Text
parenta7c67c897ecebe339078b212a93a35a54a6fc143 (diff)
Docbook writer: don't print empty id attributes.
Thanks to Steve Horne for reporting.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Docbook.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs
index b10317506..19f8f2f11 100644
--- a/src/Text/Pandoc/Writers/Docbook.hs
+++ b/src/Text/Pandoc/Writers/Docbook.hs
@@ -114,7 +114,8 @@ elementToDocbook opts lvl (Sec _ _num (id',_,_) title elements) =
n | n == 0 -> "chapter"
| n >= 1 && n <= 5 -> "sect" ++ show n
| otherwise -> "simplesect"
- in inTags True tag [("id", writerIdentifierPrefix opts ++ id')] $
+ in inTags True tag [("id", writerIdentifierPrefix opts ++ id') |
+ not (null id')] $
inTagsSimple "title" (inlinesToDocbook opts title) $$
vcat (map (elementToDocbook opts (lvl + 1)) elements')