> From: Ihor Radchenko > Date: Sat, 13 Apr 2024 14:00:48 +0000 > > Protesilaos Stavrou writes: > >> With regard to the disambiguation scheme, I am playing around with >> various scenaria to see how Org HTML export behaves. Using the >> following: >> ... >> This is test 2 1 >> ... >> This is test 3 1 >> >> Notice that the 100 in the ID is not incremented further. I guess this >> is something that can be worked on but, again, I think it is separate >> from the issue of using the label for the ID and HREF. >> >> Any thoughts? > > Duplicate IDs are against HTML spec: > https://softwareengineering.stackexchange.com/questions/127178/two-html-elements-with-same-id-attribute-how-bad-is-it-really > > So, this is a bug. Indeed! We can look into this separately. >>>> Though I should have clarified my intent earlier: the idea is to use the >>>> label as a fixed reference to the footnote, so that the link does not >>>> change between exports. This is the same principle as what we do with >>>> links to headings that have a CUSTOM_ID. >>>> >>>> As such, the anchor text can still be the way it is now as an >>>> automatically generated number sequence (^1, ^2, etc.), but the HTML >>>> "id" and "href" values will be constructed based on the label of the >>>> footnote, NOT its number in the sequence. > > See the attached tentative patch. > [... 144 lines elided] Thank you! I just tried it. I encountered two problems with it, which I am addressing with the two attached patches (feel free to modify as needed). In short: 1. The footnote definitions at the bottom of the file were still using the ordinal HTML id, which did not correspond to the href with the label. 2. If the file had a mixture of labeled and anonymous/unlabeled footnotes, then the export would break as it would be passing a nil value to 'string-to-number'. Please let me know how to proceed. -- Protesilaos Stavrou https://protesilaos.com