From public at misuse.org Tue Jan 16 15:41:32 2007
From: public at misuse.org (Steve Midgley)
Date: Tue, 16 Jan 2007 12:41:32 -0800
Subject:
and
in RedCloth v. Textism
Message-ID: <20070116204855.26B8D524159A@rubyforge.org>
Hi,
I'm using RedCloth right now for some simple markup in a Rails project.
It's simple and easy - thanks for a great tool!
I have a question about an apparent discrepancy between RedCloth and
Textile, relating to newline characters. I've played with the
"hard_breaks" feature and that seems to generate it's own problems..
If I go onto the Textile test page:
http://www.textism.com/tools/textile/index.php
And enter the following text:
test
text
other
I get back:
test
text
other
In IRB if I try to feed an equivalent string to RedCloth I get
(accounting for hard_breaks on and off here):
irb(main):006:0> val = RedCloth.new("test\ntext\n\nother")
=> "test\ntext\n\nother"
irb(main):007:0> val.hard_breaks = true
=> true
irb(main):008:0> val.to_html
=> "test
text
\nother
"
irb(main):009:0> val.hard_breaks = false
=> false
irb(main):010:0> val.to_html
=> "test\ntext
\n\n\n\tother
"
Basically, RedCloth either passes the single newline between "test" and
"text" unparsed, or it adds only
tags and fails to create the
correct tag for "other"..
Textile seems to convert the single newline into a
character and
the double newline into a
tag. The Textile behavior is greatly
preferred for me.
I snooped around in the redcloth.rb source file and found this on line
597:
def hard_break( text )
text.gsub!( /(.)\n(?!\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
" )
if hard_breaks
end
I believe that the problem is that this gsub is not accounting for the
idea that there might be two newlines consecutively (or separated only
by whitespace). In the case where there are two such newlines, I
believe this pattern should not match and therefore the double newlines
will be handed off for additional (correct) processing by the paragraph
generator, rather than only one of them being sub'ed with a
tag.
I tried just changing "(.)" to "([^\n])" but that didn't have the
effect I was looking for..
I'd be happy to do a little work if someone can give me direction on
patching this issue - this regex is pretty complicated and seems loaded
with assumptions that I don't understand, so I'm hesitant to monkey
with it without help.
Or am I barking up a non-existent tree? Is there a way already to do
what I want without a code change?
Thanks for any insight and assistance and especially for such a great
tool!
Steve
p.s. I saw these postings in the archives which are related:
http://rubyforge.org/pipermail/redcloth-upwards/2006-June/000041.html
http://rubyforge.org/pipermail/redcloth-upwards/2006-August/000077.html
June 2006 claims that the exact problem I have is fixed! But I'm still
having it.. Any patch around that can help?!
p.p.s. (I'm on version 3.0.4, at least according the folder that it's
installed - I did a gems install but just compared that to the tar.gz
file from the website, which is the same..)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20070116/240e05b0/attachment.html
From why at hobix.com Tue Jan 23 16:37:43 2007
From: why at hobix.com (why the lucky stiff)
Date: Tue, 23 Jan 2007 15:37:43 -0600
Subject: RedCloth and SuperRedCloth
Message-ID: <20070123213742.GD72976@beekeeper.hobix.com>
Good day to the parliament of RedCloth followers gathered here.
Grave matters at hand!!
I'm personally quite unhappy with the state of RedCloth and am
reluctant to release the code in the repository. I can't say if the
code works with any confidence because I can't generate the
(Poignant) Guide with the current RedCloth. I know some things are
fixed, but I'm afraid that much is still broken. I think I'd rather
re-release 3.0.3 as 3.0.5, you know?
So, my first question is: what to do with the RedCloth 3.x series??
---
The next pressing item is SuperRedCloth.[1] This library is much
faster, much cleaner, but also much smaller. I don't plan on
supporting DocBook or any other formats other than true XHTML. If
you want to convert to DocBook, i'd suggest XHTML-to-DocBook. Most
importantly, I want SuperRC to be small and performant.
Compatibility with RedCloth 3.0.3 is very important to me as well.
All of 3.0.3's tests should come out identical to SuperRC.
So, my second question: are you guys okay with SuperRC becoming
RedCloth 4 eventually?
Thanks for hanging in there!!
_why
From cardmagic at gmail.com Tue Jan 23 16:47:01 2007
From: cardmagic at gmail.com (Lucas Carlson)
Date: Tue, 23 Jan 2007 13:47:01 -0800
Subject: RedCloth and SuperRedCloth
In-Reply-To: <20070123213742.GD72976@beekeeper.hobix.com>
References: <20070123213742.GD72976@beekeeper.hobix.com>
Message-ID:
I am in total support of SuperRC becoming RedCloth 4. _why, you have
my support.
-Lucas
http://rufy.com/
On Jan 23, 2007, at 1:37 PM, why the lucky stiff wrote:
> Good day to the parliament of RedCloth followers gathered here.
> Grave matters at hand!!
>
> I'm personally quite unhappy with the state of RedCloth and am
> reluctant to release the code in the repository. I can't say if the
> code works with any confidence because I can't generate the
> (Poignant) Guide with the current RedCloth. I know some things are
> fixed, but I'm afraid that much is still broken. I think I'd rather
> re-release 3.0.3 as 3.0.5, you know?
>
> So, my first question is: what to do with the RedCloth 3.x series??
>
> ---
>
> The next pressing item is SuperRedCloth.[1] This library is much
> faster, much cleaner, but also much smaller. I don't plan on
> supporting DocBook or any other formats other than true XHTML. If
> you want to convert to DocBook, i'd suggest XHTML-to-DocBook. Most
> importantly, I want SuperRC to be small and performant.
>
> Compatibility with RedCloth 3.0.3 is very important to me as well.
> All of 3.0.3's tests should come out identical to SuperRC.
>
> So, my second question: are you guys okay with SuperRC becoming
> RedCloth 4 eventually?
>
> Thanks for hanging in there!!
>
> _why
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards
From me at mboffin.com Tue Jan 23 17:01:59 2007
From: me at mboffin.com (Dylan Bennett)
Date: Tue, 23 Jan 2007 14:01:59 -0800
Subject: RedCloth and SuperRedCloth
In-Reply-To:
References: <20070123213742.GD72976@beekeeper.hobix.com>
Message-ID: <8a38c5900701231401x473c0d05w23b002e224827097@mail.gmail.com>
> > So, my second question: are you guys okay with SuperRC becoming
> > RedCloth 4 eventually?
I'm all for that.
--Dylan
From curtis.schofield at gmail.com Tue Jan 23 17:34:58 2007
From: curtis.schofield at gmail.com (Curtis Schofield)
Date: Tue, 23 Jan 2007 15:34:58 -0700
Subject: RedCloth and SuperRedCloth
In-Reply-To: <8a38c5900701231401x473c0d05w23b002e224827097@mail.gmail.com>
References: <20070123213742.GD72976@beekeeper.hobix.com>
<8a38c5900701231401x473c0d05w23b002e224827097@mail.gmail.com>
Message-ID: <55944C3A-82AA-48BC-B6FB-070802B63DD5@gmail.com>
On 23-Jan-07, at 3:01 PM, Dylan Bennett wrote:
>>> So, my second question: are you guys okay with SuperRC becoming
>>> RedCloth 4 eventually?
>
> I'm all for that.
yay!
From jg at jasongarber.com Tue Jan 23 20:47:31 2007
From: jg at jasongarber.com (Jason Garber)
Date: Tue, 23 Jan 2007 20:47:31 -0500
Subject: RedCloth and SuperRedCloth
Message-ID: <53ED4E4F-31D3-47AE-ADEC-54E763DA90D5@jasongarber.com>
> I can't say if the code works with any confidence because I can't
> generate the
> (Poignant) Guide with the current RedCloth. I know some things are
> fixed, but
> I'm afraid that much is still broken.
Why can't you generate the Poignant Guide? What problems are you
experiencing with the latest RedCloth? I checked out poignant/trunk
and it seemed to generate just fine for me, but I'm sure I don't have
a clue compared to you.
> I think I'd rather re-release 3.0.3 as 3.0.5, you know?
I'd rather keep forward momentum, but failing that, re-releasing
3.0.3 is better than keeping 3.0.4 out there.
> So, my first question is: what to do with the RedCloth 3.x series??
Depends on how badly it's broken. Are there ways we can find out?
Trunk is working great for me, but I haven't written any books with
it either.
> Compatibility with RedCloth 3.0.3 is very important to me as well.
Proper functioning of :filter_html and :hard_breaks are very
important to me. Filter HTML is important because...
# This is a nice thing if you're using RedCloth for
# formatting in public places (e.g. Wikis) where you
# don't want users to abuse HTML for bad things.
SuperRC should include these options (and tests for them), IMHO.
> So, my second question: are you guys okay with SuperRC becoming
> RedCloth 4 eventually?
That would be amazing. It being Ragel makes it less "open," but as
long as it works well, speed is huge. Who knows, maybe it'll
stimulate more people to learn Ragel?
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20070123/a133016a/attachment.html
From Bil.Kleb at nasa.gov Tue Jan 23 20:48:39 2007
From: Bil.Kleb at nasa.gov (Bil Kleb)
Date: Tue, 23 Jan 2007 20:48:39 -0500
Subject: RedCloth and SuperRedCloth
In-Reply-To: <20070123213742.GD72976@beekeeper.hobix.com>
References: <20070123213742.GD72976@beekeeper.hobix.com>
Message-ID: <45B6BAF7.2000303@NASA.gov>
why the lucky stiff wrote:
>
> So, my second question: are you guys okay with SuperRC becoming
> RedCloth 4 eventually?
Go Dogs Go.
Later,
--
Bil
From wybo at logilogi.org Tue Jan 23 17:44:31 2007
From: wybo at logilogi.org (Wybo Wiersma)
Date: Tue, 23 Jan 2007 23:44:31 +0100
Subject: RedCloth and SuperRedCloth
In-Reply-To: <20070123213742.GD72976@beekeeper.hobix.com>
References: <20070123213742.GD72976@beekeeper.hobix.com>
Message-ID: <20070123224430.GA8530@logilogi.org>
> re-release 3.0.3 as 3.0.5, you know?
I would be for that, although I think the code in the rep is
definitely neater than the 3.0.3/4.
> So, my second question: are you guys okay with SuperRC becoming
> RedCloth 4 eventually?
I added an extension of my own to parse links consisting of
two parts "wo":link;"rd":another_link;, and it'll be hard to
add this to the new one without constant patching or private
forking, so I'm ambiguous about it.
It would be great if some way to set/add rules remained in
place.
greetings,
Wybo Wiersma
> Thanks for hanging in there!!
>
> _why
--
::Student:
- History, Informatiekunde (computer linguistics, IR, webtech) and Philosophy
- Member of the Center for Metahistory Groningen (http://www.rug.nl/let/cmg)
::Free Software and Open Source Developer:
- http://www.LogiLogi.org, innovative system for cumulative, shared commenting,
publication and idea sharing: Web as it should be...
- ComLinToo, a computational linguistics toolset written in Perl
- Lake (LogiLogi.org Make), a make-replacement using makefiles in pure C++
::Being:
- In the world, go figure (http://nl.logilogi.org/HomE/WyboWiersma)
From Joe.McGlynn at codegear.com Thu Jan 18 22:59:21 2007
From: Joe.McGlynn at codegear.com (Joe McGlynn)
Date: Thu, 18 Jan 2007 19:59:21 -0800
Subject: Problems with redcloth 304
Message-ID: <487EC64B71EEB740A76BF519218275A501150AA2@USSVS-EXCH01.amer.borl.net>
I posted this to the project admins, one of whom suggusted that I post
it here. I'm using redcloth in an application I'm working on, and was
having all sorts of markup problems. I thought it might be something I
was doing wrong, but apparently not:
I'd really like to see this get back to a stable release!
Joe
============================
There are, as I'm sure you know, several bugs in 304. I thought it
was my usage, but after looking through some newsgroups it appears
that these were introduced in this release and 303 is better.
Apparently the tip revision is better too.
Is this project still active? Is there a plan to get a fixed-up
305 out? Any timeframe?
This is a nice plugin, it's just largely unusable in its current form!
From Joe.McGlynn at codegear.com Tue Jan 23 17:02:18 2007
From: Joe.McGlynn at codegear.com (Joe McGlynn)
Date: Tue, 23 Jan 2007 14:02:18 -0800
Subject: RedCloth and SuperRedCloth
In-Reply-To: <20070123213742.GD72976@beekeeper.hobix.com>
Message-ID: <487EC64B71EEB740A76BF519218275A5011CAF0B@USSVS-EXCH01.amer.borl.net>
I'm not familiar with superrc, where can I find out more?
As an aside: In my app I used textilize and had all sorts of issues
(Rails 1.2 rc2 and rc 3.0.4) (headings not terminating, lists not
terminating, etc). I changed it to directly call rc as
RedCloth.new("xxx").to_html and it worked much better.
Joe
> -----Original Message-----
> From: redcloth-upwards-bounces at rubyforge.org
> [mailto:redcloth-upwards-bounces at rubyforge.org] On Behalf Of
> why the lucky stiff
> Sent: Tuesday, January 23, 2007 1:38 PM
> To: redcloth-upwards at rubyforge.org
> Subject: RedCloth and SuperRedCloth
>
> Good day to the parliament of RedCloth followers gathered here.
> Grave matters at hand!!
>
> I'm personally quite unhappy with the state of RedCloth and
> am reluctant to release the code in the repository. I can't
> say if the code works with any confidence because I can't generate the
> (Poignant) Guide with the current RedCloth. I know some
> things are fixed, but I'm afraid that much is still broken.
> I think I'd rather re-release 3.0.3 as 3.0.5, you know?
>
> So, my first question is: what to do with the RedCloth 3.x series??
>
> ---
>
> The next pressing item is SuperRedCloth.[1] This library is
> much faster, much cleaner, but also much smaller. I don't
> plan on supporting DocBook or any other formats other than
> true XHTML. If you want to convert to DocBook, i'd suggest
> XHTML-to-DocBook. Most importantly, I want SuperRC to be
> small and performant.
>
> Compatibility with RedCloth 3.0.3 is very important to me as well.
> All of 3.0.3's tests should come out identical to SuperRC.
>
> So, my second question: are you guys okay with SuperRC
> becoming RedCloth 4 eventually?
>
> Thanks for hanging in there!!
>
> _why
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards
>
From why at hobix.com Wed Jan 24 00:22:45 2007
From: why at hobix.com (why the lucky stiff)
Date: Tue, 23 Jan 2007 23:22:45 -0600
Subject: Strikethroughs and dashes
Message-ID: <20070124052245.GF72976@beekeeper.hobix.com>
Who really uses strikethroughs?? This is one of the most common
tripwires in RedCloth.
You are the friend--the only friend--who has offered to help.
Obviously em dashes.
I died in -2006- wait, no, two-thousand-FIVE!
Obviously strikethrough.
I'm going on a trip - a long one - to the Virgin Islands.
That's got to be en dashes.
Such a cheap, no-hassle, no-worry guarantee!!
Hyphens, but can be confusing to parsers.
All but the first work with Trad. RedCloth. Have you encountered other
sticky scenarios I can add to the tests? Maybe I can scale back the
strikethroughs in SuperRC?
_why
From jg at jasongarber.com Wed Jan 24 00:52:38 2007
From: jg at jasongarber.com (Jason Garber)
Date: Wed, 24 Jan 2007 00:52:38 -0500
Subject: Strikethroughs and dashes
In-Reply-To: <20070124052245.GF72976@beekeeper.hobix.com>
References: <20070124052245.GF72976@beekeeper.hobix.com>
Message-ID:
> Maybe I can scale back the strikethroughs in SuperRC?
That would be great! I've seen many people get hung up with em-dash-
laden sentences. The more advertising background they have, the
worse they are with this. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20070124/ebfd0d0b/attachment.html
From why at hobix.com Wed Jan 24 01:28:41 2007
From: why at hobix.com (why the lucky stiff)
Date: Wed, 24 Jan 2007 00:28:41 -0600
Subject: Strikethroughs and dashes
In-Reply-To: <20070124052245.GF72976@beekeeper.hobix.com>
References: <20070124052245.GF72976@beekeeper.hobix.com>
Message-ID: <20070124062840.GG72976@beekeeper.hobix.com>
On Tue, Jan 23, 2007 at 11:22:45PM -0600, why the lucky stiff wrote:
>
> I died in -2006- wait, no, two-thousand-FIVE!
>
Okay, in SuperRedCloth:
space dash words+ dash space
Strict just like that!!
You can can have spaces and some punctuation between words, but the
dashes must be up against the first and last words of the phrase.
It still smells, though. What if you have to strike-out something
with dashes in it?? I guess it's back to ...
There should be a syntax for grouping text.
I died in -(two thousand six -- yes i did -- fell off a cliff)-
-- no, wait, I died in 2005 while jogging...
Who knows.
_why
From murphy at rubychan.de Wed Jan 24 01:54:47 2007
From: murphy at rubychan.de (murphy)
Date: Wed, 24 Jan 2007 07:54:47 +0100
Subject: Strikethroughs and dashes
In-Reply-To: <20070124062840.GG72976@beekeeper.hobix.com>
References: <20070124052245.GF72976@beekeeper.hobix.com>
<20070124062840.GG72976@beekeeper.hobix.com>
Message-ID: <45B702B7.4090205@rubychan.de>
why the lucky stiff wrote:
> Okay, in SuperRedCloth:
>
> space dash words+ dash space
>
> Strict just like that!!
great to see you working on RedCloth again :D
while your at it: any change to include lists?
I already proposed them here in december :)
red is beautiful!
[murphy]
From mat.mannion at gmail.com Wed Jan 24 05:15:53 2007
From: mat.mannion at gmail.com (Mat Mannion)
Date: Wed, 24 Jan 2007 10:15:53 +0000
Subject: Strikethroughs and dashes
In-Reply-To: <20070124052245.GF72976@beekeeper.hobix.com>
References: <20070124052245.GF72976@beekeeper.hobix.com>
Message-ID:
One sticky scenario we get a lot in our application is people putting two
smilies somewhere in their post.
Here is a smilie :-) And another :-( Bugger!
Comes out with a strikethrough... Undesired!
On 1/24/07, why the lucky stiff wrote:
>
> Who really uses strikethroughs?? This is one of the most common
> tripwires in RedCloth.
>
> You are the friend--the only friend--who has offered to help.
>
> Obviously em dashes.
>
> I died in -2006- wait, no, two-thousand-FIVE!
>
> Obviously strikethrough.
>
> I'm going on a trip - a long one - to the Virgin Islands.
>
> That's got to be en dashes.
>
> Such a cheap, no-hassle, no-worry guarantee!!
>
> Hyphens, but can be confusing to parsers.
>
> All but the first work with Trad. RedCloth. Have you encountered other
> sticky scenarios I can add to the tests? Maybe I can scale back the
> strikethroughs in SuperRC?
>
> _why
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards
>
--
Mat Mannion
Web Developer
M: 07725 216 409
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20070124/6ca7ee14/attachment.html
From hgs at dmu.ac.uk Wed Jan 24 05:07:06 2007
From: hgs at dmu.ac.uk (Hugh Sasse)
Date: Wed, 24 Jan 2007 10:07:06 +0000 (WET)
Subject: Strikethroughs and dashes
In-Reply-To: <20070124062840.GG72976@beekeeper.hobix.com>
References: <20070124052245.GF72976@beekeeper.hobix.com>
<20070124062840.GG72976@beekeeper.hobix.com>
Message-ID:
On Wed, 24 Jan 2007, why the lucky stiff wrote:
> On Tue, Jan 23, 2007 at 11:22:45PM -0600, why the lucky stiff wrote:
> >
> > I died in -2006- wait, no, two-thousand-FIVE!
> >
>
> Okay, in SuperRedCloth:
>
> space dash words+ dash space
/\s+\-\b(.*)\b\-\s/
>
> Strict just like that!!
>
> You can can have spaces and some punctuation between words, but the
> dashes must be up against the first and last words of the phrase.
>
> It still smells, though. What if you have to strike-out something
> with dashes in it?? I guess it's back to ...
>
> There should be a syntax for grouping text.
>
> I died in -(two thousand six -- yes i did -- fell off a cliff)-
> -- no, wait, I died in 2005 while jogging...
irb(main):001:0> regexp=/\s+\-\b(.*)\b\-\s/
=> /\s+\-\b(.*)\b\-\s/
irb(main):002:0> str= " I died in -2048 -- yes -- ate my own dogfood- no, just now"
=> " I died in -2048 -- yes -- ate my own dogfood- no, just now"
irb(main):003:0> str =~ regexp
=> 10
irb(main):004:0> puts $1
2048 -- yes -- ate my own dogfood
=> nil
irb(main):006:0>
Hmm, is that sufficient?
irb(main):006:0> str = " what - will - this - do?"
=> " what - will - this - do?"
irb(main):007:0> str =~ regexp
=> nil
No, I haven't prised the lid off to see if this uses regexps
or a Proper parser.
>
> Who knows.
>
> _why
I don't know enough about Super Red Cloth to add anything useful,
except that if it makes it easier to maintain, that is good. I'm
not clear about how Ragel fits into the picture yet, whether we
need to install that as well to get it to work or what.
Hugh
From why at hobix.com Wed Jan 24 11:52:42 2007
From: why at hobix.com (why the lucky stiff)
Date: Wed, 24 Jan 2007 10:52:42 -0600
Subject: Definition lists (was Re: Strikethroughs and dashes)
In-Reply-To: <45B702B7.4090205@rubychan.de>
References: <20070124052245.GF72976@beekeeper.hobix.com>
<20070124062840.GG72976@beekeeper.hobix.com>
<45B702B7.4090205@rubychan.de>
Message-ID: <20070124165241.GA96785@beekeeper.hobix.com>
On Wed, Jan 24, 2007 at 07:54:47AM +0100, murphy wrote:
> while your at it: any change to include lists?
> I already proposed them here in december :)
Definitions are already a part of RedCloth 3. I'm not sure who
introduced them or when, but...
- Foo :=
definition
- Bar := definition
Some Textile hacks use:
@ Foo ~ definition
@ Bar ~ definition
Textil.pm is:
dl. Foo:definition
Bar:definition
I think I like the WikiCode syntax better. I'm open to this in
SuperRC, let's just be sure to allow styling and alignment as with
the other elements.
;(highlight) Foo : definition
;{color:red} Bar : definition
Also, PyTextile and Textile v2 should be checked for a precedent
perhaps.
_why
From why at hobix.com Wed Jan 24 11:58:06 2007
From: why at hobix.com (why the lucky stiff)
Date: Wed, 24 Jan 2007 10:58:06 -0600
Subject: Strikethroughs and dashes
In-Reply-To:
References: <20070124052245.GF72976@beekeeper.hobix.com>
<20070124062840.GG72976@beekeeper.hobix.com>
Message-ID: <20070124165806.GB96785@beekeeper.hobix.com>
On Wed, Jan 24, 2007 at 10:07:06AM +0000, Hugh Sasse wrote:
> > Okay, in SuperRedCloth:
> >
> > space dash words+ dash space
>
> /\s+\-\b(.*)\b\-\s/
Not quite. The definition of "words" isn't (.*). It's a bit more
complicated!!
> irb(main):002:0> str= " I died in -2048 -- yes -- ate my own dogfood- no, just now"
> => " I died in -2048 -- yes -- ate my own dogfood- no, just now"
> irb(main):003:0> str =~ regexp
> => 10
> irb(main):004:0> puts $1
> 2048 -- yes -- ate my own dogfood
That's correct. Dashes are found up against the "2048" and
"dogfood", so that would be a strike.
But you bring up yet another great ambiguity: negative numbers!!
> irb(main):006:0> str = " what - will - this - do?"
> => " what - will - this - do?"
> irb(main):007:0> str =~ regexp
> => nil
That's also correct. Those dashes are en dashes. There's no
question there.
> I don't know enough about Super Red Cloth to add anything useful,
> except that if it makes it easier to maintain, that is good. I'm
> not clear about how Ragel fits into the picture yet, whether we
> need to install that as well to get it to work or what.
You won't need to install Ragel unless you're compiling from the
repo. The tarball and gem dists will be premade for ya. See
Hpricot and Mongrel -- same thing.
_why
From why at hobix.com Wed Jan 24 12:01:19 2007
From: why at hobix.com (why the lucky stiff)
Date: Wed, 24 Jan 2007 11:01:19 -0600
Subject: Strikethroughs and dashes
In-Reply-To:
References: <20070124052245.GF72976@beekeeper.hobix.com>
Message-ID: <20070124170119.GC96785@beekeeper.hobix.com>
On Wed, Jan 24, 2007 at 10:15:53AM +0000, Mat Mannion wrote:
> Here is a smilie :-) And another :-( Bugger!
Oh, yes. That's a good one.
SuperRC does:
Here is a smilie :–) And another :–( Bugger!
While RedCloth 3 does:
Here is a smilie :) And another :( Bugger!
So, progress.
_why
From public at misuse.org Wed Jan 24 13:23:16 2007
From: public at misuse.org (Steve Midgley)
Date: Wed, 24 Jan 2007 10:23:16 -0800
Subject:
and in RedCloth v. Textism
In-Reply-To:
References:
Message-ID: <20070124190445.34FA852409C3@rubyforge.org>
Hi,
First, I support any move to fix RedCloth! So SuperRedCloth as v4 seems
great to me!
FYI, for anyone who cares, I'm working around my problems with RedCloth
and hard breaks by postprocessing the resulting html like so, which
converts any
followed by a newline into followed by a
newline. It's not perfect of course, but seems to fit my most painful
issues:
retval = textilize(h(value))
retval.gsub(%r{
\s*\n}, "\n")
Also, I see some mention of v3.03 or tip revision as being preferred to
v3.04?
Can anyone provide a short description of what's better about 3.03 or
tip? And how I might go about deciding to change to one of these
versions?
Thanks,
Steve
At 02:35 PM 1/23/2007, redcloth-upwards-request at rubyforge.org wrote:
>Message: 6
>Date: Tue, 16 Jan 2007 12:41:32 -0800
>From: Steve Midgley
>Subject:
and in RedCloth v. Textism
>To: redcloth-upwards at rubyforge.org.
>Message-ID: <20070116204855.26B8D524159A at rubyforge.org>
>Content-Type: text/plain; charset="us-ascii"
>
>Hi,
>
>I'm using RedCloth right now for some simple markup in a Rails
>project.
>It's simple and easy - thanks for a great tool!
>
>I have a question about an apparent discrepancy between RedCloth and
>Textile, relating to newline characters. I've played with the
>"hard_breaks" feature and that seems to generate it's own problems..
>
>If I go onto the Textile test page:
>
>http://www.textism.com/tools/textile/index.php
>
>And enter the following text:
>
>test
>text
>
>other
>
>I get back:
>
>
test
>text
>
> other
>
>In IRB if I try to feed an equivalent string to RedCloth I get
>(accounting for hard_breaks on and off here):
>
>irb(main):006:0> val = RedCloth.new("test\ntext\n\nother")
>=> "test\ntext\n\nother"
>irb(main):007:0> val.hard_breaks = true
>=> true
>irb(main):008:0> val.to_html
>=> "test
text
\nother
"
>irb(main):009:0> val.hard_breaks = false
>=> false
>irb(main):010:0> val.to_html
>=> "test\ntext
\n\n\n\tother
"
>
>Basically, RedCloth either passes the single newline between "test"
>and
>"text" unparsed, or it adds only
tags and fails to create the
>correct tag for "other"..
>
>Textile seems to convert the single newline into a
character
>and
>the double newline into a
tag. The Textile behavior is greatly
>preferred for me.
>
>I snooped around in the redcloth.rb source file and found this on line
>
>597:
>
> def hard_break( text )
> text.gsub!( /(.)\n(?!\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
"
> )
>if hard_breaks
> end
>
>I believe that the problem is that this gsub is not accounting for the
>
>idea that there might be two newlines consecutively (or separated only
>
>by whitespace). In the case where there are two such newlines, I
>believe this pattern should not match and therefore the double
>newlines
>will be handed off for additional (correct) processing by the
>paragraph
>generator, rather than only one of them being sub'ed with a
>tag.
>I tried just changing "(.)" to "([^\n])" but that didn't have the
>effect I was looking for..
>
>I'd be happy to do a little work if someone can give me direction on
>patching this issue - this regex is pretty complicated and seems
>loaded
>with assumptions that I don't understand, so I'm hesitant to monkey
>with it without help.
>
>Or am I barking up a non-existent tree? Is there a way already to do
>what I want without a code change?
>
>Thanks for any insight and assistance and especially for such a great
>tool!
>
>Steve
>
>p.s. I saw these postings in the archives which are related:
>http://rubyforge.org/pipermail/redcloth-upwards/2006-June/000041.html
>http://rubyforge.org/pipermail/redcloth-upwards/2006-August/000077.html
>
>June 2006 claims that the exact problem I have is fixed! But I'm still
>
>having it.. Any patch around that can help?!
>
>p.p.s. (I'm on version 3.0.4, at least according the folder that it's
>installed - I did a gems install but just compared that to the tar.gz
>file from the website, which is the same..)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20070124/8c126af1/attachment.html
From bret at pettichord.com Wed Jan 24 19:48:08 2007
From: bret at pettichord.com (Bret Pettichord)
Date: Wed, 24 Jan 2007 18:48:08 -0600
Subject: Definition lists (was Re: Strikethroughs and dashes)
In-Reply-To: <20070124165241.GA96785@beekeeper.hobix.com>
References: <20070124052245.GF72976@beekeeper.hobix.com>
<20070124062840.GG72976@beekeeper.hobix.com>
<45B702B7.4090205@rubychan.de>
<20070124165241.GA96785@beekeeper.hobix.com>
Message-ID:
Is there a spec for textile? Is redcloth supposed to conform to a spec?
I am concerned that we are seeing the development of several incompatible
dialects of textile.
Bret
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20070124/86815c08/attachment-0001.html
From why at hobix.com Wed Jan 24 21:28:13 2007
From: why at hobix.com (why the lucky stiff)
Date: Wed, 24 Jan 2007 20:28:13 -0600
Subject: Definition lists (was Re: Strikethroughs and dashes)
In-Reply-To:
References: <20070124052245.GF72976@beekeeper.hobix.com>
<20070124062840.GG72976@beekeeper.hobix.com>
<45B702B7.4090205@rubychan.de>
<20070124165241.GA96785@beekeeper.hobix.com>
Message-ID: <20070125022257.GA46718@beekeeper.hobix.com>
On Wed, Jan 24, 2007 at 06:48:08PM -0600, Bret Pettichord wrote:
> Is there a spec for textile? Is redcloth supposed to conform to a spec?
It's an informal sort of thing. I mean the reference[1] is very basic,
giving plenty of room for interpretation.
Like: type a few long-nosed smilies into that page. There's no
science to the dwimmyness of it.
_why
From murphy at rubychan.de Thu Jan 25 01:01:38 2007
From: murphy at rubychan.de (murphy)
Date: Thu, 25 Jan 2007 07:01:38 +0100
Subject: Definition lists (was Re: Strikethroughs and dashes)
In-Reply-To: <20070124165241.GA96785@beekeeper.hobix.com>
References: <20070124052245.GF72976@beekeeper.hobix.com> <20070124062840.GG72976@beekeeper.hobix.com> <45B702B7.4090205@rubychan.de>
<20070124165241.GA96785@beekeeper.hobix.com>
Message-ID: <45B847C2.4030803@rubychan.de>
why the lucky stiff schrieb:
> Definitions are already a part of RedCloth 3. I'm not sure who
> introduced them or when, but...
>
> - Foo :=
> definition
> - Bar := definition
um...doesn't work for me.
rico:~ murphy$ gem list redcloth
RedCloth (3.0.4)
rico:~ murphy$ redcloth
- foo := bar
- foo := bar
am I wrong?
[murphy]
From cardmagic at gmail.com Thu Jan 25 01:30:41 2007
From: cardmagic at gmail.com (Lucas Carlson)
Date: Wed, 24 Jan 2007 22:30:41 -0800
Subject: Definition lists (was Re: Strikethroughs and dashes)
In-Reply-To: <45B847C2.4030803@rubychan.de>
References: <20070124052245.GF72976@beekeeper.hobix.com> <20070124062840.GG72976@beekeeper.hobix.com> <45B702B7.4090205@rubychan.de>
<20070124165241.GA96785@beekeeper.hobix.com>
<45B847C2.4030803@rubychan.de>
Message-ID: <7FE984C3-84DB-41B0-A9E9-ACEF9B9D49CD@rufy.com>
It is in svn trunk, not 3.0.4
-Lucas
http://rufy.com/
On Jan 24, 2007, at 10:01 PM, murphy wrote:
> why the lucky stiff schrieb:
>> Definitions are already a part of RedCloth 3. I'm not sure who
>> introduced them or when, but...
>>
>> - Foo :=
>> definition
>> - Bar := definition
> um...doesn't work for me.
>
> rico:~ murphy$ gem list redcloth
>
> RedCloth (3.0.4)
>
> rico:~ murphy$ redcloth
> - foo := bar
> - foo := bar
>
>
> am I wrong?
> [murphy]
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards
From murphy at rubychan.de Thu Jan 25 02:10:07 2007
From: murphy at rubychan.de (murphy)
Date: Thu, 25 Jan 2007 08:10:07 +0100
Subject: Definition lists (was Re: Strikethroughs and dashes)
In-Reply-To: <7FE984C3-84DB-41B0-A9E9-ACEF9B9D49CD@rufy.com>
References: <20070124052245.GF72976@beekeeper.hobix.com> <20070124062840.GG72976@beekeeper.hobix.com> <45B702B7.4090205@rubychan.de> <20070124165241.GA96785@beekeeper.hobix.com> <45B847C2.4030803@rubychan.de>
<7FE984C3-84DB-41B0-A9E9-ACEF9B9D49CD@rufy.com>
Message-ID: <45B857CF.4010801@rubychan.de>
Lucas Carlson schrieb:
> It is in svn trunk, not 3.0.4
my bad, it works now. thank you!
[murphy]
From hgs at dmu.ac.uk Thu Jan 25 05:22:32 2007
From: hgs at dmu.ac.uk (Hugh Sasse)
Date: Thu, 25 Jan 2007 10:22:32 +0000 (WET)
Subject: Strikethroughs and dashes
In-Reply-To: <20070124165806.GB96785@beekeeper.hobix.com>
References: <20070124052245.GF72976@beekeeper.hobix.com>
<20070124062840.GG72976@beekeeper.hobix.com>
<20070124165806.GB96785@beekeeper.hobix.com>
Message-ID:
On Wed, 24 Jan 2007, why the lucky stiff wrote:
> On Wed, Jan 24, 2007 at 10:07:06AM +0000, Hugh Sasse wrote:
> > > Okay, in SuperRedCloth:
> > >
> > > space dash words+ dash space
> >
> > /\s+\-\b(.*)\b\-\s/
>
> Not quite. The definition of "words" isn't (.*). It's a bit more
> complicated!!
:-) This was just to get the ends about right as a first shot.
>
> > irb(main):002:0> str= " I died in -2048 -- yes -- ate my own dogfood- no, just now"
> > => " I died in -2048 -- yes -- ate my own dogfood- no, just now"
> > irb(main):003:0> str =~ regexp
> > => 10
> > irb(main):004:0> puts $1
> > 2048 -- yes -- ate my own dogfood
>
> That's correct. Dashes are found up against the "2048" and
> "dogfood", so that would be a strike.
>
> But you bring up yet another great ambiguity: negative numbers!!
New dimensions in temporal physics... :-) Good point though, I
hadn't thought of that. How to strikeout a negative number?
-\-2048 -- That was way back in negative time!-
>
> > irb(main):006:0> str = " what - will - this - do?"
> > => " what - will - this - do?"
> > irb(main):007:0> str =~ regexp
> > => nil
>
> That's also correct. Those dashes are en dashes. There's no
> question there.
:-)
>
> > I don't know enough about Super Red Cloth to add anything useful,
> > except that if it makes it easier to maintain, that is good. I'm
> > not clear about how Ragel fits into the picture yet, whether we
> > need to install that as well to get it to work or what.
>
> You won't need to install Ragel unless you're compiling from the
> repo. The tarball and gem dists will be premade for ya. See
> Hpricot and Mongrel -- same thing.
Thanks. (OT: Is it pronounced more like Rigel or Bagel, soft or hard
g?)
>
> _why
Hugh
From bret at pettichord.com Fri Jan 26 18:10:26 2007
From: bret at pettichord.com (Bret Pettichord)
Date: Fri, 26 Jan 2007 17:10:26 -0600
Subject: titles in textile
Message-ID:
Any ideas on a good way to embed titles in a textile file?
I am creating a number of textile files that i convert, one-by-one to html.
I would really like to include the title in the file itself. I am talking
about the tag in the of the document. It would be easy to add
this in post processing based on the first h1 tag or the name of the file
itself, but i was wondering of there were other ideas, in the case where it
wouldn't exactly match either of these. Thoughts?
Bret
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20070126/c27cf2a8/attachment.html
From why at hobix.com Sun Jan 28 01:44:55 2007
From: why at hobix.com (why the lucky stiff)
Date: Sun, 28 Jan 2007 00:44:55 -0600
Subject: ^SUPER^ _RED_ ~CLOTH~ 1.153
Message-ID: <20070128064454.GE21066@beekeeper.hobix.com>
New gems (source and win32):
gem install superredcloth --source http://code.whytheluckystiff.net
Use it like:
SuperRedCloth.new("_huh?_").to_html
Okay, getting close! A lot more tests are passing. There are still
about 50 tests failing. Most of these are due to ol/ul list
problems.
Here's what's still broken:
* Options (:hard_breaks, :filter_html, etc.)
* Lists (specifically: grouping list items into a single list)
* ... (I need to take a different approach.)
* No markdown tags (Still thinking about this.)
Seriously. That's all that's left. A good number of failing tests
just need to be altered because of slight whitespace differences.
Or updated approaches (scaling back strikethroughs, float v.
text-align, etc.)
_why
From jg at jasongarber.com Sun Jan 28 23:51:56 2007
From: jg at jasongarber.com (Jason Garber)
Date: Sun, 28 Jan 2007 23:51:56 -0500
Subject: ^SUPER^ _RED_ ~CLOTH~ 1.153
In-Reply-To: <20070128064454.GE21066@beekeeper.hobix.com>
References: <20070128064454.GE21066@beekeeper.hobix.com>
Message-ID:
Seriously amazing. Great work!
On Jan 28, 2007, at 1:44 AM, why the lucky stiff wrote:
> New gems (source and win32):
>
> gem install superredcloth --source http://code.whytheluckystiff.net
>
> Use it like:
>
> SuperRedCloth.new("_huh?_").to_html
>
> Okay, getting close! A lot more tests are passing. There are still
> about 50 tests failing. Most of these are due to ol/ul list
> problems.
>
> Here's what's still broken:
>
> * Options (:hard_breaks, :filter_html, etc.)
> * Lists (specifically: grouping list items into a single list)
> * ... (I need to take a different approach.)
> * No markdown tags (Still thinking about this.)
>
> Seriously. That's all that's left. A good number of failing tests
> just need to be altered because of slight whitespace differences.
> Or updated approaches (scaling back strikethroughs, float v.
> text-align, etc.)
>
> _why
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards