# RedCloth to\_html strange behaviour

**URL:** <https://www.ruby-forum.com/t/redcloth-to-html-strange-behaviour/76703>\
**Category:** Rails\
**Created:** [November 20, 2006, 4:26pm UTC](https://www.ruby-forum.com/t/redcloth-to-html-strange-behaviour/76703 "2006-11-20T16:26:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roman\_Semenenko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@Roman\_Semenenko](https://www.ruby-forum.com/u/Roman_Semenenko)\
**Post date:** [November 20, 2006, 4:26pm UTC](https://www.ruby-forum.com/t/redcloth-to-html-strange-behaviour/76703/1 "2006-11-20T16:26:40Z")

</div>

Hi

I’m parsing user’s input with RedCloth library.  
But it removes all spaces between elements, rounded by “\*” , “\_” , also  
between these elements and normal text.

Example :

> > ./script/console  
> > Loading development environment.
> 
> > RedCloth.new(“a baba _gala_ _maga_”).to\_html  
> > =\> “
> > 
> > a&nbsp;baba **gala** _maga_
> > 
> > ”

But in irb - everything is ok:

irb(main):003:0\> RedCloth.new(“a baba _gala_ _maga_”).to\_html  
=\> “

a baba **gala** _maga_

”

Can anyone tell me what is the problem here ?  
thanks.

---

<div class="post-metadata">

**Author:** ![Roman\_Semenenko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@Roman\_Semenenko](https://www.ruby-forum.com/u/Roman_Semenenko)\
**Post date:** [November 20, 2006, 5:11pm UTC](https://www.ruby-forum.com/t/redcloth-to-html-strange-behaviour/76703/2 "2006-11-20T17:11:01Z")

</div>

which redcloth are you using?  
I know there are strange problems with paragraphs and hard\_breaks in  
3.0.4:  
[http://wiki.rubyonrails.org/rails/pages/RedCloth](http://wiki.rubyonrails.org/rails/pages/RedCloth)

Roman Semenenko wrote:

> =\> “
> 
> a&nbsp;baba **gala** _maga_
> 
> ”
> 
> >

–  
I do things for love or money

---

<div class="post-metadata">

**Author:** ![Roman\_Semenenko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@Roman\_Semenenko](https://www.ruby-forum.com/u/Roman_Semenenko)\
**Post date:** [November 20, 2006, 9:16pm UTC](https://www.ruby-forum.com/t/redcloth-to-html-strange-behaviour/76703/3 "2006-11-20T21:16:05Z")

</div>

Roman,

I read somewhere that 3.0.4. was buggy, and downgrading to version  
3.0.3. of the gem solved my textile-related problems.

Alain

---

<div class="post-metadata">

**Author:** ![Roman\_Semenenko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@Roman\_Semenenko](https://www.ruby-forum.com/u/Roman_Semenenko)\
**Post date:** [November 21, 2006, 1:32pm UTC](https://www.ruby-forum.com/t/redcloth-to-html-strange-behaviour/76703/4 "2006-11-21T13:32:51Z")

</div>

Yes , thank you guys , 3.0.3 works perfect ))

---

<div class="post-metadata">

**Author:** ![Roman\_Semenenko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@Roman\_Semenenko](https://www.ruby-forum.com/u/Roman_Semenenko)\
**Post date:** [November 21, 2006, 1:28pm UTC](https://www.ruby-forum.com/t/redcloth-to-html-strange-behaviour/76703/5 "2006-11-21T13:28:50Z")

</div>

Thank you all guys , 3.0.3 work perfect ))
