Forum: Ruby on Rails RE: Re: truncating html text

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F01c3ff32fee35d911e81c172a005012?d=identicon&s=25 Tom Fakes (Guest)
on 2005-12-23 20:09
(Received via mailing list)
Why don't you truncate the text before you wrap it in the tags?  This
would be the easiest way to avoid the problem.
C8a634a01a2c4508360874bff7fb1a7f?d=identicon&s=25 Kevin Olbrich (Guest)
on 2005-12-24 14:08
Tom Fakes wrote:
> Why don't you truncate the text before you wrap it in the tags?  This
> would be the easiest way to avoid the problem.

I'm starting with textile markup text, so there will be some decoration
in there even before I convert it to html.  Doing the truncate on the
markup is better because you are less likely to cut a tag in half, and
because when you do the conversion to html, you don't get malformed html
tags.

This is an intermediate solution for now.
This topic is locked and can not be replied to.