Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@leungbk
Copy link
Contributor

@leungbk leungbk commented Apr 29, 2022

Fixes #6441.

@tarleb
Copy link
Collaborator

tarleb commented Apr 29, 2022

Thanks for this, looks good! Can we generalize and reuse the code in figure to get the attributes, or are there subtle differences that would make this difficult?

@leungbk
Copy link
Contributor Author

leungbk commented Apr 30, 2022

Thanks for this, looks good! Can we generalize and reuse the code in figure to get the attributes, or are there subtle differences that would make this difficult?

Because of the need to wrap tables in a div to ensure compatibility with pandoc-citeproc, I've decided to not use the name/label as the attr ID; the name/label will be used as an HTML ID in that enclosing div.

In contrast, given how figures are represented, it makes sense to pass non-empty name/label as the attr ID there. Until #813 is resolved, we will have to continue to treat tables and figures differently in this manner. For this reason, I don't think it is presently worth it to reuse the code in figure.

@tarleb
Copy link
Collaborator

tarleb commented Apr 30, 2022

I assume you mean pandoc-crossref, not pandoc-citeproc (I keep confusing those, too). Does that mean pandoc-crossref expects the wrapping Div and won't work if all attributes are added to the table? That's surprising to me.

To be honest, I had forgotten about the wrapper Div. Now I wonder whether we should go the next step and get rid of the wrapper. Compat with pandoc-crossref would be a sufficient reason to keep it for now, so I just to make sure: are you positive that folding the Attr into the table will cause compatibility problems?

* Remove the div wrapper since pandoc-crossref detects the table attr.

* Update named-table test in Tests/Readers/Org/Block/Table.hs, as well
as 3706.md, to account for the removal of the div wrapper and the
addition of attrs.
@leungbk
Copy link
Contributor Author

leungbk commented May 1, 2022

are you positive that folding the Attr into the table will cause compatibility problems?

I tried it just now after also removing the Div and found no issues.

@tarleb
Copy link
Collaborator

tarleb commented May 2, 2022

Great, thank you! Nice and clean 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Org reader support for ATTR_HTML tables

2 participants