aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-09-06 09:25:52 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-09-06 09:25:52 -0700
commitc544f20d6fc2771a9a7bb4fe38e4cb9fe18e14d2 (patch)
treeacd7e6cf4120705e7c44b00616f3b3a6317285e4
parentfbab8e528646bcf9e2cd62bc06f24c577994f430 (diff)
downloadpandoc-c544f20d6fc2771a9a7bb4fe38e4cb9fe18e14d2.tar.gz
Made --id-prefix work in DocBook as well as HTML.
Closes #607.
-rw-r--r--README4
-rw-r--r--src/Text/Pandoc/Writers/Docbook.hs2
2 files changed, 3 insertions, 3 deletions
diff --git a/README b/README
index 2fa8cbce5..4ac115a19 100644
--- a/README
+++ b/README
@@ -415,8 +415,8 @@ Options affecting specific writers
`--id-prefix`=*STRING*
: Specify a prefix to be added to all automatically generated identifiers
- in HTML output. This is useful for preventing duplicate identifiers
- when generating fragments to be included in other pages.
+ in HTML and DocBook output. This is useful for preventing duplicate
+ identifiers when generating fragments to be included in other pages.
`-T` *STRING*, `--title-prefix=`*STRING*
: Specify *STRING* as a prefix at the beginning of the title
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs
index e696fc63e..a38f57074 100644
--- a/src/Text/Pandoc/Writers/Docbook.hs
+++ b/src/Text/Pandoc/Writers/Docbook.hs
@@ -103,7 +103,7 @@ 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",id')] $
+ in inTags True tag [("id", writerIdentifierPrefix opts ++ id')] $
inTagsSimple "title" (inlinesToDocbook opts title) $$
vcat (map (elementToDocbook opts (lvl + 1)) elements')