Docbook writer: don't print empty id attributes.

Thanks to Steve Horne for reporting.
This commit is contained in:
John MacFarlane 2015-02-25 06:59:43 -08:00
parent a7c67c897e
commit ae3142f919

View file

@ -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')