Skip to content

Commit

Permalink
Made --id-prefix work in DocBook as well as HTML.
Browse files Browse the repository at this point in the history
Closes #607.
  • Loading branch information
jgm committed Sep 6, 2012
1 parent fbab8e5 commit c544f20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Writers/Docbook.hs
Expand Up @@ -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')

Expand Down

0 comments on commit c544f20

Please sign in to comment.