I use redcarpet and kramdown trying to render the output in a block. It outputs the following result with HTML tags in the UI instead of rendering the output in a block. How can I use redcarpet and kramdown to render the output in an actual block(see the follwing expected output?
PS: My ruby project didn't have any HTML files, the HTML code is handled by another team and I don't have access to modify the HTML code. I produce the output and it will post it to the UI.
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :fenced_code_blocks=> true)
a=markdown.render("```hello```")
puts Kramdown::Document.new(a).to_html
#=> <p><code>Hello</code><p>
I would like to see hello wrapped with the rectangle instead of wrapping the hello with tags.Just like in stackoverflow when we use ``` it will wrap the information inside the grey rectangle expected output:
Hello
Hello
`, (All I did was inspect the source of this page) so it appears that the markdown is doing exactly what is expected. The rest of the styling is just CSS – engineersmnky Oct 04 '22 at 21:00