-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is id on img instead of containing figure #65
Comments
Thanks for your question, and sorry for the delay. The choice of where to put the id (either in the I don't see a way for pandoc-fignos (as a filter) to overcome this. The fundamental problem is that while pandoc's abstract syntax has an Image type, it does not have a Figure type. So an id is necessarily associated with an Image at the filter stage . The conversion to an html Maybe file an issue with pandoc? I see that you have submitted an issue to pandoc-tablenos about this, and will address tables separately there. |
Hi Tom, thanks for the response. No need to reply to the tables one too. You can just reference this response. I think in the time since I asked this question, I noticed that it was actually a problem with pandoc. As I recall, and as you mentioned above, a limitation of its internal abstract syntax tree. Feel free to close the issue. |
Yes, that is exactly what I see: a limitation of pandoc's internal abstract syntax tree. I will have a separate look at the tables issue. There is a Table type in pandoc's AST, so it may be possible to move the id there. I'm not sure, but I will check. Cheers, |
The output of
fignos
seems to put the id/anchor to the image in the<img>
tag itself instead of in the containing<figure>
element. It might seem sensible to put it on the<img>
, however there may be cases where it causes inconvenience.For example, I'm working on a project called manubot where we take the html output from
pandoc
, usingtablenos
andfignos
, and insert javascript "plugins" to add certain handy functionality to the manuscript. One of the plugins briefly highlights/glows an element when a user clicks a relative (eghref="#introduction"
) link to it. In the case of a figure, I want to highlight both the<img>
and its associated<figcaption>
- in other words, everything contained in the<figure>
. It is the same issue with #11 ontablenos
.It's a minor grievance, but I think it's most sensible to put the id on the thing that is actually being referenced, which is the whole figure object. Same thing with the tables, having the id right on the table.
The text was updated successfully, but these errors were encountered: