Opened 14 years ago
Closed 14 years ago
#366 closed defect (wontfix)
multidoc generates duplicate id attributes for HTML output
Reported by: | Moritz Heidkamp | Owned by: | Ivan Raikov |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | unknown | Version: | 4.6.x |
Keywords: | Cc: | ||
Estimated difficulty: |
Description
Titles beginning with e.g. numbers will result in illegal HTML id attributes. The attached patch fixes this by allowing only letters at the beginning of generated ids. Note that there is also potential for multidoc to generate the same id multiple times inside the same document.
Attachments (2)
Change History (11)
Changed 14 years ago by
Attachment: | remove-invalid-chars-from-beginning-of-id.patch added |
---|
comment:1 Changed 14 years ago by
Owner: | changed from sjamaan to Ivan Raikov |
---|---|
Status: | new → assigned |
Summary: | multidoc generates invalid id attributes for HTML output → multidoc generates duplicate id attributes for HTML output |
Changed 14 years ago by
Attachment: | unique-ids.patch added |
---|
comment:2 Changed 14 years ago by
The unique-ids.patch takes a stab at fixing this issue. I used the secret *preorder/ss* binding modifier, not sure whether that is a Good Idea. I also changed it in such a way that html-transformation-rules
doesn't require the contents to be passed to it anymore to build the table of contents. However, I kept the single argument signature for now so as not to break existing code. If you choose to apply the patch, feel free to change that, of course :-)
comment:3 follow-up: 4 Changed 14 years ago by
Ivan: I'll let you decide whether this is an acceptable way to deal with this.
comment:4 Changed 14 years ago by
Yes, I will look at it, also need to check if the latex and texinfo backends are consistent with how they handle this. Do you want to add a test case to unit tests for this?
Replying to sjamaan:
Ivan: I'll let you decide whether this is an acceptable way to deal with this.
comment:5 Changed 14 years ago by
I've modified "simple.sxml" to include two subsections with the title "Subsection", which triggers the bug.
I've also added test programs which loop through all the sxml files and produce html, latex and texinfo output files to make testing a little easier. Turns out that the LaTeX and Texinfo rulesets crash on tables in the "bb" testcase.
I noticed that the sxml files were incomplete in the sense that they could not be converted to full standalone html files or LaTeX or Texinfo files. That's because the qwiki conversion rules are missing. I decided to make the tests independent of qwiki stuff; they should be testing multidoc, not qwiki! Multidoc should be capable of functioning without loading qwiki. Ideally, the tests should work without requiring a rule for translating the wiki-page tag into LaTeX/Texinfo document headers or html+body tags. Perhaps some functionality should be moved around between multidoc and qwiki so we have a fully standalone multidoc for generic "documents", which qwiki is only one program which produces those from wiki-specific documents.
Sorry for the long story, but I felt it was important :)
comment:6 follow-up: 7 Changed 14 years ago by
Any news on the unique-ids.patch? Sorry, just bumping the ticket so it doesn't get lost :-)
comment:7 Changed 14 years ago by
I have looked at the patch, but I think preorder/ss is a bit of a hack. But passing the content to the stylesheet constructor is also a hack, so I want to rewrite the transformations to use foldts, which can carry unique id information in the accumulator argument. I will have a little bit of time to work on it this week, and I will let you know if it will be possible to go the foldts route.
Replying to syn:
Any news on the unique-ids.patch? Sorry, just bumping the ticket so it doesn't get lost :-)
comment:8 Changed 14 years ago by
Milestone: | 4.7.0 |
---|
comment:9 Changed 14 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Properly fixing and developing multidoc requires developers who do not break software at whim. I will merge the html-part of multidoc with the stringozzi that is qwiki, and will develop a new implementation from scratch, possibly based on pandoc.
I've applied your patch, thanks! The multiple IDs with the same name is a known problem, but a little hard to fix right now, I'm afraid. (at least not without nasty hackery)
Maybe Ivan has an idea?
I've renamed the title of this ticket to reflect the fact that still needs fixing.