Bluecloth: markdown to HTML results in lots of empty tags

67 views Asked by At

For example, the following markdown:

# Game Version
Need For Speed Most Wanted v1.3 English version.

Results in the following HTML:

<h1>Game Version</h1>
<p></p>
<p></p>
<p>Need For Speed Most Wanted v1.3 English version.</p>
<p></p>
<p></p>

This is even more annoying in lists where every <li></li> is <br><li></li><br>, contrary to the markdown spec. I have checked my markdown and there are no extra end-of-line spaces or anything of the sort. The data is stored as a text field on Heroku Postgres.

Is this a problem with Bluecloth, or am I doing something terribly wrong?

1

There are 1 answers

0
peteykun On BEST ANSWER

I was actually calling simple_format on the returned string in the view:

simple_format BlueCloth.new(@event.description)

Replacing simple_format with raw fixed the problem.