git.iko.soy/typeable/pandoc
on master help sign in
Docbook writer: don't print empty id attributes.

Thanks to Steve Horne for reporting.

commitae3142f919a29900c8d53e486e02d40125b5a542 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 25 Feb 2015, 06:59 (12 years ago) parenta7c67c8
1 file changed+2−1
src/Text/Pandoc/Writers/Docbook.hs+2−1
src/Text/Pandoc/Writers/Docbook.hs+2−1
@@ -114,7 +114,8 @@ elementToDocbook opts lvl (Sec _ _num (id',_,_) title elements) =
114114 n | n == 0 -> "chapter"
115115 | n >= 1 && n <= 5 -> "sect" ++ show n
116116 | otherwise -> "simplesect"
117− in inTags True tag [("id", writerIdentifierPrefix opts ++ id')] $
117+ in inTags True tag [("id", writerIdentifierPrefix opts ++ id') |
118+ not (null id')] $
118119 inTagsSimple "title" (inlinesToDocbook opts title) $$
119120 vcat (map (elementToDocbook opts (lvl + 1)) elements')
120121