Open adamflorin opened 11 years ago
FWIW
I get the same error by essentially this:
Attach my renderer somewhere accessible:
NameSpace.text_renderer = Redcarpet::Markdown.new(TextRenderer, opts)
Spin up an instance, and inside that instance call it again:
text_renderer.render text
### Inside TextRenderer
def block_code(file_path, content)
# . . .
NameSpace.text_renderer.render content
# . . .
end
I'll use @lynxnathan's suggestion of just making a new instance but thought I'd pass on another use case.
(In my case, I'm not using the fenced code block for code, I'm using it for a figure caption, and I want to be able to put bold text etc in the figure caption, thus I need to render inside as well).
We're seeing this also: RedCarpet 3.3.4, Ruby 2.2.5
Please see reproducible case:
https://gist.github.com/adamflorin/7045640
If I use a Markdown instance repeatedly to render text, and raise an error within a custom formatting callback, eventually Redcarpet (or Sundown?) will crash, bringing down Ruby with it, with the error:
In my case, I can just instantiate a new Redcarpet instance each time I render, so this is not pressing for me. But perhaps of interest to you?