many thanks tobias,
that has worked perfectly! just some notes of what i have done incase someone
else wants to do this in the future ..
i''ve uploaded the ''lib/bluecloth.rb'' file to the
''lib'' directory of my rails
application, and put the plain text into a variable called message. then using
the bluecloth syntax have added to my view:
<% bc = BlueCloth::new( message ) %>
<%= bc.to_html %>
then, to format the blockquote into a thunderbird ''quote
colors'' extension
style look, i''ve placed the following css between the <head> tags
of the .rhtml
file:
<style>
<!--
blockquote {border-left:2px solid #cc3300; padding-left: .5cm; background:
#f8f8f8;"}
-->
</style>
and thus the quoted text looks better than anything else at the moment!
luke
----- Original Message -----
From: "Tobias Luetke"
<tobias.luetke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "luke" <lduncalfe-ZKwmMI9HCDA@public.gmane.org>;
<rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org>
Sent: Tuesday, July 12, 2005 3:37 PM
Subject: Re: [Rails] quote colors
In markdown > is valid syntax for blockquoting and it supports nested
block quotes.
Install bluecloth, run it over your text and see if you like the result.
You should be able to do what you want with some good CSS
On 7/11/05, luke <lduncalfe-ZKwmMI9HCDA@public.gmane.org>
wrote:> hi all
>
> is there a library or piece of code that will take anything that is
">
replied> text" and pop it into a table, like how the ''quote
colors'' extension works in
> thunderbird?
>
> quotecolors.mozdev.org
>
> some messages in my database are taken directly from email, so as a result
they> have plain text inline replies that:
>
> > look like
> > this
>
> and it would be very nice to be able to format these as html tables
instead.
>
> i''ve attempted to write some very crusty ruby code, that at the
moment will
> colour the reply differently:
>
> <% message.each_line do |line|
> if line =~ />(.*)/ then
> line = "<font color=#999999>" + $1 +
"</font>"
> end %>
> <%= line %>
> <% end %>
>
> each line of the printed message has the <font> and </font>
tags either side.
> what i''m unsure of is how to write a regular expression that would
identify
the> beginning of a quoted passage, begin an html table, and at the end of the
> quoted passage would end the html table.
>
> or if there is some sort of library for doing this ...
>
> i hope that makes sense.
>
> many thanks
> luke
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> lists.rubyonrails.org/mailman/listinfo/rails
>
--
Tobi
snowdevil.ca - Snowboards that don''t suck
typo.leetsoft.com - Open source weblog engine
blog.leetsoft.com - Technical weblog