-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Trying to render a blockquote throws an exception right now:
user> (markdown->clj-pdf "> This is a quote")
java.lang.IllegalArgumentException: No matching field found: getLiteral for class org.commonmark.node.BlockQuoteThe issue is that the :default case of the render method relies on .getLiteral on the parsed element. This works fine for code blocks etc, but blockquotes are parsed differently by commonmark-java. For this case it creates a BlockQuote containing one or more Paragraph nodes. The BlockQuote node itself has no .getLiteral implementation, hence the error.
Something like this seems to work, but I'm not familiar enough with this lib and clj-pdf to be sure it's entirely the right approach:
(defmethod render :BlockQuote
[pdf-config node]
(->> node
(render-children* pdf-config)
(wrap-paragraph pdf-config node)))It also has the downside of using a plain :paragraph, which makes it hard to style quotes.
Metadata
Metadata
Assignees
Labels
No labels