SimpleMDE & RedCarpet
So i have set up my forum with simpleMDE and i'm using RedCarpet to parse the markdown. Everything works great except when it parses the markdown, it adds extra set of <p>
tags before and after my post content. Anyone had experience with theses too and might have a clue why this is happening.
Here is the code snippet of the Renderer.
def markdown(content)
@markdown ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML, {
autolink: true,
space_after_headers: true,
fenced_code_blocks: true,
underline: true,
highlight: true,
footnotes: true,
tables: true
})
@markdown.render(content)
end
Thanks
potential solution to this would be postprocessing and using regrex to remove those extra p tags.
Hey Jack. The problem is this. <p></p><p>content goes here</p><p></p>
Notice the extra opening and closing p tags before and after the content p tags.
I have a similar problem. When I 'm on the edit action the content of the textarea I'm having the SimpleMDE is diplaying indented like you see on the screenshot
.