RedCloth Bug

I just experienced this weird bug in RedCloth 3.0.4 where line breaks are not handled properly. I talked to a friend about it and found out that it was a known bug which, unfortunately, hasn’t been fixed yet. Anyway, you guys can try this patch until a new RedCloth version comes out which will hopefully fix this. Just change the hard_break function to:

text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks

And this is just another reason why it would be wise to freeze your gems.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: