rootstock icon indicating copy to clipboard operation
rootstock copied to clipboard

Make sure ids go on the elements they actually belong on

Open vincerubinetti opened this issue 5 years ago • 1 comments

In response to #284, I think it's very important that the ids of things go on the actual element they should be on, and nothing else.

The HTML for figures looks like this:

image

There is no reason for the extra <div>. All of its attributes -- including the id -- should go on the <figure> element.

The HTML for references looks like this:

image

The id should go on the <p> and the containing <div> is not necessary.

This would get rid of the modifications and checks I have to do in the plugins, as mentioned in #284, and would lead to much simpler, cleaner, more intuitive, and more predictable output.

I don't know what changed, whether it was pandoc, fignos, or something we did. But I really think we need to do everything we can to enforce this behavior, even if it means maintaining our own fork of fignos that puts the id in a sensible place.

vincerubinetti avatar Dec 12 '19 21:12 vincerubinetti

Regarding the ids for figures and tables, see https://github.com/jgm/pandoc/issues/684#issuecomment-479955298, https://github.com/tomduck/pandoc-fignos/issues/65, and https://github.com/tomduck/pandoc-tablenos/issues/11. I think the issue is that pandoc doesn't support setting ids for all attributes. Therefore, pandoc-fignos is forced to adopt the div workaround (there is no way to put the id on the figure element).

Regarding the references and putting the id on the paragraph, I'm guessing that is a pandoc decision. You could open an issue on Pandoc, although I'm not sure what considerations went into using the div.

dhimmel avatar Dec 13 '19 17:12 dhimmel