git.iko.soy/typeable/pandoc
on master help sign in
Made --id-prefix work in DocBook as well as HTML.

Closes #607.

commitc544f20d6fc2771a9a7bb4fe38e4cb9fe18e14d2 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 6 Sep 2012, 09:25 (14 years ago) parentfbab8e5
2 files changed+3−3
README+2−2 src/Text/Pandoc/Writers/Docbook.hs+1−1
README+2−2
@@ -415,8 +415,8 @@ Options affecting specific writers
415415
416416`--id-prefix`=*STRING*
417417: Specify a prefix to be added to all automatically generated identifiers
418− in HTML output. This is useful for preventing duplicate identifiers
419− when generating fragments to be included in other pages.
418+ in HTML and DocBook output. This is useful for preventing duplicate
419+ identifiers when generating fragments to be included in other pages.
420420
421421`-T` *STRING*, `--title-prefix=`*STRING*
422422: Specify *STRING* as a prefix at the beginning of the title
src/Text/Pandoc/Writers/Docbook.hs+1−1
@@ -103,7 +103,7 @@ elementToDocbook opts lvl (Sec _ _num id' title elements) =
103103 n | n == 0 -> "chapter"
104104 | n >= 1 && n <= 5 -> "sect" ++ show n
105105 | otherwise -> "simplesect"
106− in inTags True tag [("id",id')] $
106+ in inTags True tag [("id", writerIdentifierPrefix opts ++ id')] $
107107 inTagsSimple "title" (inlinesToDocbook opts title) $$
108108 vcat (map (elementToDocbook opts (lvl + 1)) elements')
109109