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
Allow AsciiDoc table cell to be accessed from inner document #4380
Comments
The reason we cannot set |
To make this more generic, we could consider We could also consider |
asciidoctor-epub3 currently has to do some hacks due to inability to traverse document tree up from cell document. See asciidoctor/asciidoctor-epub3#473 |
I wonder if that's reason enough to promote this fix to the 2.0.x series. wdyt? |
That would be very nice (and the feature itself looks very safe and nonintrusive). The hardest thing is deciding on the name :) I'm fine with any of outer_cell/outer_node. The latter is more future-proof in case there emerge any new contexts with nested documents. To be honest, I never understood why cell contents is a document at all instead of just a block. I assume this is some kind of legacy. |
Yes, it was necessary to match compatibility with Asciidoctor's predecessor. (Asciidoctor's predecessor actually shelled out to itself to process an AsciiDoc table cell as a standalone document). It's something we can revisit in the language spec, and is still on the bill to address. |
An AsciiDoc table cell has a single child node, which is an inner AsciiDoc document. This document can be accessed from the cell node through the
inner_document
property. However, it's not possible to access the reverse relationship. The inner AsciiDoc document can only access the parent document through theparent_document
property. This can make writing extensions that traverse the document tree difficult.Introduce a new property on the inner document named
parent_cell
to access the AsciiDoc table cell from the inner document it contains.Here's an example:
The text was updated successfully, but these errors were encountered: