Replies: 1 comment 1 reply
-
I'm sorry you're getting affected by that. This is a Quarto bug that unfortunately is quite hard to fix; it arises from the fact that we need to preprocess the .qmd input that contains shortcodes, and this processing breaks the (delicate) text structure required for grid tables to be recognized. Specifically, this happens deep in Quarto, here: https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/pandoc/datadir/readqmd.lua#L129 The bad news is that if it's already quite hard for us to fix properly, and I think it's much harder for you to detect this. You could attempt a filter like such: Table = function(pandoc_table)
quarto._quarto.walk(pandoc_table, {
Shortcode = function(shortcode)
warn("This shortcode is inside a table")
end
})
end The problem is that this will trigger in any pandoc Table nodes, and so will emit many false positives. In addition, depending on how badly the readqmd.lua processing mangles the Grid table, the shortcode might even end up outside the Table node itself. So you're not guaranteed to catch the problem. The only way I know to meaningfully fix this is to:
This is not a task I want to take on lightly, because it's going to be very delicate and time-consuming, and our development time is already taken. (I'm telling you the plan in case you're sufficiently bothered by this that you're willing to contribute an implementation of this!) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hi,
my question is following #10084, where is stated that usage of shortcodes in grid tables is broken.
Is there a possibility to detect in my custom LUA shortcode, in which environment (e.g. "grid table") the shortcode was used in the quarto document?
I would like to detect this broken use of shortcode and issue a meaningful error message.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions