# Suggestion Textile rendering

**URL:** <https://www.ruby-forum.com/t/suggestion-textile-rendering/92402>\
**Category:** Radiant CMS\
**Created:** [April 19, 2007, 4:02am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402 "2007-04-19T04:02:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [April 19, 2007, 4:02am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402/1 "2007-04-19T04:02:25Z")

</div>

Could we turn on newlines to   
 rendering in Textile filter for  
Radiant…

It seems to me that most applications for breaks at 80 chars or  
whatever have long since passed.

My users are constantly confused by putting breaks into their text  
and getting no breaks on the final page.

Update:

I’ve fixed this by putting the following in my textile\_filter.rb file.

class RedCloth

# Patch for RedCloth. Fixed in RedCloth r128 but \_why hasn’t

released it yet.

# \<a href="[http://code.whytheluckystiff.net/redcloth/changeset/](http://code.whytheluckystiff.net/redcloth/changeset/)

128"\>[http://code.whytheluckystiff.net/redcloth/changeset/128](http://code.whytheluckystiff.net/redcloth/changeset/128)  
def hard\_break( text )  
text.gsub!( /(.)\n(?!\n|\Z| _([#_=]+(\s|$)|[{|]))/, "\1\<br /

> " ) if hard\_breaks  
> end  
> end

class TextileFilter \< TextFilter  
description\_file File.dirname( **FILE** ) + “/…/textile.html”  
def filter(text)  
RedCloth.new(text, [:hard\_breaks] ).to\_html  
end  
end

The fix for Redcloth comes from the rails wiki:  
[http://wiki.rubyonrails.com/rails/pages/RedCloth](http://wiki.rubyonrails.com/rails/pages/RedCloth)

---

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [April 19, 2007, 4:48am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402/2 "2007-04-19T04:48:28Z")

</div>

Adam S. wrote:

> Could we turn on newlines to   
> rendering in Textile filter for  
> Radiant…
> 
> It seems to me that most applications for breaks at 80 chars or  
> whatever have long since passed.

Personally I don’t think so. If I edit my content with a normal editor  
I want it to break at column 75. Furthermore, I may chose to render  
the content not only as HTML but also as text as it was originally  
edited. So I wouldn’t be happy if the Textile filter would render line  
breaks differently than any other of my output filters.

> My users are constantly confused by putting breaks into their text  
> and getting no breaks on the final page.

From a typographic point of view I don’t see the need for line breaks,  
but maybe you can fill me in.

Cheers,  
Oliver

---

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [April 19, 2007, 6:38am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402/3 "2007-04-19T06:38:33Z")

</div>

> > My users are constantly confused by putting breaks into  
> > their text  
> > and getting no breaks on the final page.
> 
> From a typographic point of view I don’t see the need for line breaks,  
> but maybe you can fill me in.

Agreed - the only time when my users have ever had the need for line  
breaks was when they were quoting lyrics/poetry, which is a  
rare enough occurrence that   
ing is fine. Unless you’re intending on  
having lots of lyrics/poetry, there’s not really much point  
to having line-breaks.

A lot of the content on the site I run comes from emails, which tend to  
be linewrapped by email clients, so not having hard breaks  
is a feature for me.

Dan.

---

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [April 19, 2007, 8:15am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402/4 "2007-04-19T08:15:40Z")

</div>

> > Agreed - the only time when my users have ever had the need  
> > for line breaks was when they were quoting lyrics/poetry, which is a  
> > rare enough occurrence that   
> > ing is fine.
> 
> Sounds to me like a typical application of pre-formatted text
> 
> ```
> .
> Certainly, the default fixed width style would have to change.
> ```

Preformatted is different to line-broken in that preformatted text will  
not wrap (though perhaps a white-space css rule can change  
that without losing the line-breaking?)

Dan.

---

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [April 19, 2007, 7:31am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402/5 "2007-04-19T07:31:37Z")

</div>

Daniel S. wrote:

> > > My users are constantly confused by putting breaks into  
> > > their text  
> > > and getting no breaks on the final page.  
> > > From a typographic point of view I don’t see the need for line breaks,  
> > > but maybe you can fill me in.
> 
> Agreed - the only time when my users have ever had the need for line breaks was when they were quoting lyrics/poetry, which is a  
> rare enough occurrence that   
> ing is fine.

Sounds to me like a typical application of pre-formatted text

```
.
Certainly, the default fixed width style would have to change.

Cheers,  
Oliver
```

---

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [April 19, 2007, 8:42am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402/6 "2007-04-19T08:42:44Z")

</div>

On 4/19/07, Daniel S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Preformatted is different to line-broken in that preformatted text will  
> not wrap (though perhaps a white-space css rule can change  
> that without losing the line-breaking?)

See:  
[http://users.tkk.fi/~tkarvine/pre-wrap-css3-mozilla-opera-ie.html](http://users.tkk.fi/~tkarvine/pre-wrap-css3-mozilla-opera-ie.html)

---

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [April 20, 2007, 5:44am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402/7 "2007-04-20T05:44:31Z")

</div>

Adam S. wrote:

> It looks like I’m in the minority though, so I’m happy with the  
> workaround I’ve arranged.

You could easily put your changes in an extension.

–  
John

---

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [April 20, 2007, 4:54am UTC](https://www.ruby-forum.com/t/suggestion-textile-rendering/92402/8 "2007-04-20T04:54:29Z")

</div>

Right,  
Poetry is an application I hadn’t thought of, but generally with  
address information as well.

I just find that there are no times when I encounter pre-wrapped  
text… so it wouldn’t hurt to have it as an option.  
And even I myself use paragraphs close together with some semantic  
meaning, although this is a contrived example 🙂

I agree with html interspersed it would be very messy and maybe  
unusable, but what I have done is made a filter for “noobs” (aka my  
users) and left the old filter for those who want all the other  
features of Textile (aka me, I guess).

It looks like I’m in the minority though, so I’m happy with the  
workaround I’ve arranged.
