diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-02-25 06:59:43 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-02-25 06:59:43 -0800 |
commit | ae3142f919a29900c8d53e486e02d40125b5a542 (patch) | |
tree | ac6abdf62a19091f60a79eb30c97277709d38287 /src | |
parent | a7c67c897ecebe339078b212a93a35a54a6fc143 (diff) | |
download | pandoc-ae3142f919a29900c8d53e486e02d40125b5a542.tar.gz |
Docbook writer: don't print empty id attributes.
Thanks to Steve Horne for reporting.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/Docbook.hs | 3 |
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') |