help on lua script for custom writer #9427
Unanswered
AllgemeineVerunsicherung
asked this question in
Q&A
Replies: 1 comment
-
Writer = pandoc.scaffolding.Writer
function Writer ( doc, opts )
local filter = {
BlockQuote = function( bq )
bq.content:insert(1, pandoc.RawBlock('html5', '<blockquote class="foobar">'))
bq.content:insert(pandoc.RawBlock('html5', '</blockquote>'))
return bq.content
end
}
return pandoc.write(doc:walk(filter), 'html5', opts)
end This inserts the raw HTML you want at the beginning and end of the content list, and then returns the modified content list as a replacement for the BlockQuote element. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to specify a class to HTML blockquote. I created the following Lua script:
The part I am missing is the content of the blockquote. I tried with
bq.text
andbq.content
but it gives me error:attempt to concatenate a nil value (field 'text')
Blockquote needs the following structure from AST:
BlockQuote [ Para [ Str "a" , Space , Str "citation" ] ]
Beta Was this translation helpful? Give feedback.
All reactions