Ask A Question


You’re not receiving notifications from this thread.

SimpleMDE & RedCarpet

Matt Taylor asked in Gems / Libraries

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 ||=, {
      autolink: true,
      space_after_headers: true,
      fenced_code_blocks: true,
      underline: true,
      highlight: true,
      footnotes: true,
      tables: true



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



There was a issue closed long ago about that. You can find a potential solution here

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 84,256+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.