0

I'm using the redcarpet gem to render html from markdown.

The following markdown

(link)[example.com]

renders this html

<p>
    <a href="example.com">link</a>
</p>

How can I make it render html like this

<span>
    <a href="example.com">link</a>
</span>

Thanks!

prajwaldp
  • 178
  • 1
  • 14
  • 2
    Redcarpet isn't wrapping your link in a `

    `, it's wrapping the paragraph. It just so happens that the paragraph consists of nothing but a link. I realize that doesn't help you solve your problem *per se*, but hopefully it helps you understand what's going on. Here's a related GitHub issue: https://github.com/vmg/redcarpet/issues/92

    – Jordan Running Jun 30 '16 at 13:03
  • Thanks a lot! Used this line `full_document.gsub /

    (.*)<\/a><\/p>/i, '\2'` to get whatever I wanted

    – prajwaldp Jun 30 '16 at 17:20

0 Answers0