Blocks filter supposed to give whole Para for conversion into Div, but ends up putting each word into its own Div #10310
ElDuderino321
started this conversation in
General
Replies: 1 comment 1 reply
-
pandoc.Div(block.content When the block is of type pandoc.Div(pandoc.Plain(block.content) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I had a question a few weeks ago about converting paragraphs into a custom-div style for .docx convertion (s. below), and somebody gave me some code. I only tried it out a few days ago, and realized the result is not as expected. Instead of converting a whole Para block into the div, each word is div'ed individually (making the resulting .docx unsable). If I look at the AST, each word ends up as its own Plain element, which in turn is in a div.
I am grateful for the helpful suggestion, but I lack the Lua skills (so far) to figure out what went wrong. (As far as I can tell, the code is correct!)
Here is the code I used, based on the suggestion from another user (s. below):
Here is the original post and issue:
I actually only now got around to trying this out, and in the output, every word is now its own paragraph (albeit in the correct style). Looking at the resulting AST, each div contains Plain elements, which contains the Str and Space elements. Is that related to the problem?
(I also had to remove the "local" for the filter to function. Otherwise, it did not nothing. Is that a pandoc thing?)
Originally posted by @ElDuderino321 in #10124 (reply in thread)
Beta Was this translation helpful? Give feedback.
All reactions