On Fri, Nov 25, 2022 at 10:12:21PM +0000, Gavin Smith wrote: > On Tue, Nov 22, 2022 at 09:49:33PM +0000, Gavin Smith wrote: > > On Tue, Nov 22, 2022 at 10:23:24PM +0100, Patrice Dumas wrote: > > > Maybe not important if there are other changes afterwards, but with the > > > change, in HTML, the result is now invalid, as the index entries end up > > > not associated with the index term <dt>, but after the index term. This > > > is not correct, as the outer <dl> should only contain <dl> and <dt>. It > > > may not be an issue at all if you do further changes, or it could be an > > > issue to be solved in the HTML converter. > > > > I'll check this output and see I can change it to be valid again. > > I've reverted my change as I couldn't make it work out right and it is > not clearly right. > > I'm starting to think that it should be index entries *before* the @item that > are associated with the @item, not after it. I feel this may be easier to > implement. This would leave the Info output unaltered.
I thought a bit more on that issue, and indeed, even if the index entries lead to the @item when they are before the item, it could still make sense to reparent them to the @item, at the beginning instead of being before the @item, and, in HTML in the end of the previous <dt> or <dl>. I still think that a tree transformation that gather the index entries before the @item, between @item and @itemx and after @itemx and reparent them to the @item would be the best option. I do not think that it is the job of the parsing to reorganize the tree. -- Pat