Red Hat Bugzilla – Bug 553085
publican clean_ids does not check whether it assigned a duplicate ID
Last modified: 2010-11-23 23:17:23 EST
Created attachment 382134 [details]
a shortened version of the source for SystemTap Tapset Reference
Description of problem:
When running 'publican clean_ids', it looks like publican assigns a new ID to each block tag based on information such as its parent tag, book title, chapter title, and nested <title> value. This is fine, except for two things:
- 'publican clean_ids' does not check whether it has assigned a non-unique ID.
- as such, if another block tag is in the same chapter and has the same nested <title> value, it ends up with non-unique ID attributes, which fails validation and build.
Normally we wouldn't have sections in the same chapter sharing the same title, but clean_ids did this for <refsection> and <refsect1> tags (tried both). These tags are nested in <refentry>, and could be used for <title>Description</title>, <title>Values</title>, and the like.
There could be numerous <refentry> items in a <chapter> or <reference>, all with their own <refsection>s or <refsect1>s for <title>Description</title>, <title>Values</title>, etc. This is the only instance I can think of where duplicate titles occur, but I think there may be other user cases.
Version-Release number of selected component (if applicable):
I tried it out using the attached book source, which contains a <reference> and numerous nested <refentry> blocks.
Steps to Reproduce:
1. 'tar -xvf testbook.tar' ; 'cd SystemTap_Tapset_Reference'
2. 'publican build --formats=html --langs=en-US' -- build should be ok
3. 'publican clean' to remove temp XML and html files
4. 'publican clean_ids'
Running 'publican build --formats=html --langs=en-US' after clean_ids will fail, validation borks because of duplicated ID attributes assigned to <refsection>s.
publican appends a unique number/string to each ID it assigns during 'publican clean_ids' (e.g. <section id="ch-ChapterOne-Title-123">).
Modified clean ID's to set the ID on the refnamediv instead of the refsect* tags, thus preventing ID clashes without removing links.
publican-1.4-1.fc12 has been submitted as an update for Fedora 12.
publican-1.4-1.fc11 has been submitted as an update for Fedora 11.
publican-1.4-1.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
publican-1.4-1.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.