Closed sdglhm closed 4 years ago
The markup
method has no defined return value and surely does not return anything that could be rendered somewhere else. I think there is no simple way to render markup in a table like you think.
You could try to model your table in html and insert your post.content
there, then let prawn markup render the entire table.
Thank you @codez After going through the source I also thought the same. I can understand that it would be impossible for something like this to be implemented as there's no clear way to return a formatted string with things like move_down
Thank you for your response. Keep the awesome project going.
Hi,
I'm trying to add Prawn-Markup generated content into a prawn table cell. My code as follows,
And my post.content has basic markups like bold/italic/etc...
However, when I try to add
pdf.markup(post.content)
it doesn't seem to work properly and shows the following error which is totally understandable since prawn-markup doesn't output something like a text.Prawn::Errors::UnrecognizedTableContent
If I add
.to_s
method, it would render the content.But this content isn't getting rendered at the correct cell position. Following is what I get at the cell position.
#<Nokogiri::HTML::SAX::ParserContext:0x00007f97c9612070>
Is there a way I could monkey-patch something so this would render inside a prawn table?
Thank you.