Anybody use Red|Blue Cloth?

Does anybody use and prefer Redcloth (or bluecloth, which appears to be
alpha)? Does it affect performance much? Is there a way to get it to
automatically process templates without having to call textilize?

Thanks,
Joe

Joe - I use redcloth all the time for my projects. It gives my users
and easy way to mark up my documents / comments (my site, AreYouHiring
http://www.areyouhiring.com) without having to worry about HTML. In
fact, it seems safer - I can filter out pure html from the content by
using “h”, and then render what’s left via RedCloth.

I don’t see performance issues yet, but I plan to implement caching to
cover that.

I simple do something like this in a helper:

RedCloth.new(body).to_html to render my text.
Hope this helps somewhat.

Joe wrote:

Does anybody use and prefer Redcloth (or bluecloth, which appears to be
alpha)? Does it affect performance much? Is there a way to get it to
automatically process templates without having to call textilize?

I use RedCloth–which is more flexible. Overhead is negligible. As to
auto formatting, not really–unless you want to store the processed
version of your text in the database.

I like Bluecloth myself simply because I prefer the Markdown syntax. I
have
been using it as part of Typo and it works well, I have not encountered
any
issues thus far.

Tangent to this topic – has anyone found a good pattern to using
truncate
and textilize together? Perhaps have written a
smart_truncate_and_textilize
helper? Calling truncate after the textilize leaves the possibility of
unclosed or interrupted HTML tags, running truncate prior to textilize
can
result in textile markup being rendered.

Thanks!

Is there a way to use RedCloth in a controller? I can get it to work
fine in views. Something like:

def view
RedCloth.new(response).to_html
end

Joe

On 3/7/06, D. Taylor S. [email protected] wrote:

Tangent to this topic – has anyone found a good pattern to using truncate
and textilize together? Perhaps have written a smart_truncate_and_textilize
helper? Calling truncate after the textilize leaves the possibility of
unclosed or interrupted HTML tags, running truncate prior to textilize can
result in textile markup being rendered.

Thanks!

I use close_open_html(truncate(markdown(the_text), 200)) with the
close_open_html routine found here:
http://blog.ideoplex.com/2005/03/17.html. I renamed “sanitize” to
“close_open_html” because I thought that it was more descriptive.

Sincerely,

Tom L.
http://AllTom.com/
http://GadgetLife.org/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs