From justincollins at ucla.edu Wed Apr 2 20:49:06 2008 From: justincollins at ucla.edu (Justin Collins) Date: Wed, 02 Apr 2008 17:49:06 -0700 Subject: redcloth_scan.so problems Message-ID: <47F42982.7000501@ucla.edu> Hi all, I am trying to update my application to use the newest RedCloth (3.274). To do so, I have to compile it on one machine and then copy it over to the server. This has worked fine in the past, but with the latest RedCloth I'm getting a floating point exception and it crashes. Any advice on how to proceed/debug/figure out what's going wrong? Thanks, Justin From why at hobix.com Tue Apr 8 00:34:20 2008 From: why at hobix.com (_why) Date: Mon, 7 Apr 2008 23:34:20 -0500 Subject: RedCloth 3.290 gems Message-ID: <20080408043420.GA29597@beekeeper.hobix.com> Continuing our pre-release of the RedCloth 4 gems. gem install RedCloth --source http://code.whytheluckystiff.net Oh and my trouble with Gem::Platform::CURRENT is due to my cross-compilation on Linux. I need to force Gem::Platform::WIN32 so that the gem will actually work after it's built. I build the gem on Linux, so the "x86-linux" platform is used and when I index the gem repository, it throws an error. So, am I okay to just change the windows gem spec like so? _why From todd at industrialogic.com Wed Apr 9 16:37:54 2008 From: todd at industrialogic.com (Todd Persen) Date: Wed, 9 Apr 2008 16:37:54 -0400 Subject: Bug in 3.290? Message-ID: The latest gem seems to be interpreting "p.", "h2.", etc. in the middle of text. This isn't the desired effect, is it? irb(main):001:0> require 'rubygems' => true irb(main):002:0> gem 'RedCloth?', '=3.290' => true irb(main):003:0> require 'redcloth' => true irb(main):004:0> description = "I saw a ship. It ate my elephant." => "I saw a ship. It ate my elephant." irb(main):005:0> RedCloth.new(description).to_html => "

I saw a shiIt ate my elephant.

" Todd From twa at 3dbyggeri.dk Fri Apr 11 06:23:37 2008 From: twa at 3dbyggeri.dk (Thomas Watson Steen) Date: Fri, 11 Apr 2008 12:23:37 +0200 Subject: Line break bug? Message-ID: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> As far as I can read on blogs around the internet, this "bug" is not new: foo bar is translated to: "

foo bar

" and not "

foo
bar

". After searching the web for an answer it seems that the missing line- break functionality is there on purpose. What is the reason for this? ... and is there a way to "fix" it? /watson -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1936 bytes Desc: not available Url : http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080411/a33e31ed/attachment.bin From gaspard at teti.ch Fri Apr 11 08:06:39 2008 From: gaspard at teti.ch (Gaspard Bucher) Date: Fri, 11 Apr 2008 14:06:39 +0200 Subject: Line break bug? In-Reply-To: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> References: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> Message-ID: <7a9f744a0804110506p36769d91i837053bede6fb1a9@mail.gmail.com> I totally agree. I fixed it in my own projects by doing a gsub on the final result. For me (and all my clients), it's clear that when they write my name 45, funny stree 12345 MyPlace They *want* the breaks. The absence of the
is an "inverse" fix. Some form entries used to automatically wrap lines by adding "\n" (as in most web emails). The inverse fix made text entries tolerant to this "bug". Normal behaviour should definitely be to insert the
tag. When some input comes malformed, it should be unwrapped before parsing. This would really make sense. So, please add the
. Gaspard On Fri, Apr 11, 2008 at 12:23 PM, Thomas Watson Steen wrote: > As far as I can read on blogs around the internet, this "bug" is not new: > > foo > bar > > is translated to: "

foo bar

" and not "

foo
bar

". > > After searching the web for an answer it seems that the missing line-break > functionality is there on purpose. > > What is the reason for this? > ... and is there a way to "fix" it? > > /watson > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards > From jg at jasongarber.com Fri Apr 11 10:00:27 2008 From: jg at jasongarber.com (Jason Garber) Date: Fri, 11 Apr 2008 10:00:27 -0400 Subject: RedCloth 3.290 gems In-Reply-To: <20080408043420.GA29597@beekeeper.hobix.com> References: <20080408043420.GA29597@beekeeper.hobix.com> Message-ID: Glad to know why WIN32 is necessary. With WIN32, the rake aborts for me... > $ rake > rake aborted! > WIN32 has been removed, use CURRENT instead > /.../redcloth/rakefile:156 > (See full trace by running task with --trace) > > $ gem -v > 1.0.1 So, what can we do that works with both? I know next to nothing about it. On Apr 8, 2008, at 12:34 AM, _why wrote: > Continuing our pre-release of the RedCloth 4 gems. > > gem install RedCloth --source http://code.whytheluckystiff.net > > Oh and my trouble with Gem::Platform::CURRENT is due to my > cross-compilation on Linux. I need to force Gem::Platform::WIN32 so > that the gem will actually work after it's built. I build the gem > on Linux, so the "x86-linux" platform is used and when I index the > gem repository, it throws an error. > > So, am I okay to just change the windows gem spec like so? > > _why > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From work at whatcould.com Fri Apr 11 11:23:01 2008 From: work at whatcould.com (David Reese) Date: Fri, 11 Apr 2008 10:23:01 -0500 Subject: Line break bug? In-Reply-To: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> References: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> Message-ID: <47FF8255.8070205@whatcould.com> > foo > bar > > is translated to: "

foo bar

" and not "

foo
bar

". some more history: this was brought up last year in the comments on the ol' redhanded (http://redhanded.hobix.com/inspect/superredcloth1160Gems.html), where someone named fat (responded to by someone named _why, eventually this all starts to make sense) makes the common-sense argument that redcloth shouldn't ignore return marks if people put them in, and people seem to agree. this used to be a setting, :hard_breaks, which was taken out sometime, i forget if i ever read why. jason? it doesn't seem like it's a question of being hard to implement. two breaks =>

, one break =>
, right? d > > After searching the web for an answer it seems that the missing > line-break functionality is there on purpose. > > What is the reason for this? > ... and is there a way to "fix" it? > > /watson > ------------------------------------------------------------------------ > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080411/717040af/attachment.html From jg at jasongarber.com Fri Apr 11 14:14:34 2008 From: jg at jasongarber.com (Jason Garber) Date: Fri, 11 Apr 2008 14:14:34 -0400 Subject: Line break bug? In-Reply-To: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> References: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> Message-ID: <634CB19E-2848-425A-85BA-A842337104FB@jasongarber.com> RedCloth 4.0 (a.k.a. SuperRedCloth) atones for the transgressions of its predecessor and honors hard breaks. We hope to release it soon. Please help test... gem install RedCloth --source http://code.whytheluckystiff.net On Apr 11, 2008, at 6:23 AM, Thomas Watson Steen wrote: > As far as I can read on blogs around the internet, this "bug" is > not new: > > foo > bar > > is translated to: "

foo bar

" and not "

foo
bar

". > > After searching the web for an answer it seems that the missing > line-break functionality is there on purpose. > > What is the reason for this? > ... and is there a way to "fix" it? > > /watson_______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From jg at jasongarber.com Fri Apr 11 14:52:04 2008 From: jg at jasongarber.com (Jason Garber) Date: Fri, 11 Apr 2008 14:52:04 -0400 Subject: Bug in 3.290? In-Reply-To: References: Message-ID: <68D08F26-7816-4DFD-9A59-285FCC820D5C@jasongarber.com> nuts. you're right. I'm on it. http://code.whytheluckystiff.net/redcloth/ticket/46 Jason Garber Web and New Media Coordinator Eastern Mennonite University (540) 432-4198 On Apr 9, 2008, at 4:37 PM, Todd Persen wrote: > The latest gem seems to be interpreting "p.", "h2.", etc. in the > middle of text. This isn't the desired effect, is it? > > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> gem 'RedCloth?', '=3.290' > => true > irb(main):003:0> require 'redcloth' > => true > irb(main):004:0> description = "I saw a ship. It ate my elephant." > => "I saw a ship. It ate my elephant." > irb(main):005:0> RedCloth.new(description).to_html > => "

I saw a shiIt ate my elephant.

" > > Todd > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080411/af8918f2/attachment-0001.html From twa at 3dbyggeri.dk Fri Apr 11 19:26:30 2008 From: twa at 3dbyggeri.dk (Thomas Watson Steen) Date: Sat, 12 Apr 2008 01:26:30 +0200 Subject: Line break bug? In-Reply-To: <634CB19E-2848-425A-85BA-A842337104FB@jasongarber.com> References: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> <634CB19E-2848-425A-85BA-A842337104FB@jasongarber.com> Message-ID: <7A189B3F-24EF-42EF-B4C2-EC3796516DA4@3dbyggeri.dk> On 11/04/2008, at 20.14, Jason Garber wrote: > RedCloth 4.0 (a.k.a. SuperRedCloth) atones for the transgressions > of its predecessor and honors hard breaks. We hope to release it > soon. Please help test... > > gem install RedCloth --source http://code.whytheluckystiff.net Thanks :) - It worked like a charm. Now line-breaks are interpreted as expected. I'll keep using this version and of cause report any bugs I might find. /watson -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1936 bytes Desc: not available Url : http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080412/447cf0fd/attachment.bin From twa at 3dbyggeri.dk Sat Apr 12 05:37:15 2008 From: twa at 3dbyggeri.dk (Thomas Watson Steen) Date: Sat, 12 Apr 2008 11:37:15 +0200 Subject: Line break bug? In-Reply-To: <7A189B3F-24EF-42EF-B4C2-EC3796516DA4@3dbyggeri.dk> References: <3CDBCF03-496F-41FB-92A2-9C386BF853FD@3dbyggeri.dk> <634CB19E-2848-425A-85BA-A842337104FB@jasongarber.com> <7A189B3F-24EF-42EF-B4C2-EC3796516DA4@3dbyggeri.dk> Message-ID: <2724755D-2F8D-46A5-BBFD-7E0F0DB5F2D1@3dbyggeri.dk> On 12/04/2008, at 1.26, Thomas Watson Steen wrote: > Thanks :) - It worked like a charm. Now line-breaks are > interpreted as expected. I'll keep using this version and of cause > report any bugs I might find. Well, it worked on my MacBook Pro running OS X 10.4 But on my staging and production server both running FreeBSD 6.2 I get the following error: > [root at web01 ~]# gem install RedCloth --source http:// > code.whytheluckystiff.net > Building native extensions. This could take a while... > ERROR: Error installing RedCloth: > ERROR: Failed to build gem native extension. > > /usr/local/bin/ruby18 extconf.rb install RedCloth --source http:// > code.whytheluckystiff.net > checking for main() in -lc... yes > creating Makefile > > make > cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd6 -I. -fPIC -O2 - > fno-strict-aliasing -pipe -fPIC -O0 -c redcloth_inline.c > cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd6 -I. -fPIC -O2 - > fno-strict-aliasing -pipe -fPIC -O0 -c redcloth_scan.c > > cc1: out of memory allocating 637512112 bytes > *** Error code 1 > > Stop in /usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.290/ext/ > redcloth_scan. > > Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/ > gems/RedCloth-3.290 for inspection. > Results logged to /usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.290/ > ext/redcloth_scan/gem_make.out I don't know exactly what happends when I install a gem, but it seems that some C code is compiled for the specific platform. I don't know if this bug is related to RedCloth at all, but I've been unsuccessful finding anybody on the web having the same problem. So I hope you might give me some pointers... /watson -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1936 bytes Desc: not available Url : http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080412/59737de3/attachment.bin From jason at hybd.net Sat Apr 12 19:05:55 2008 From: jason at hybd.net (Jase) Date: Sun, 13 Apr 2008 00:05:55 +0100 Subject: Another possible bug... In-Reply-To: <1208041167.32050.5.camel@jase-ubuntu> References: <1208041167.32050.5.camel@jase-ubuntu> Message-ID: <1208041555.32050.8.camel@jase-ubuntu> This is to do with URL processing it appears to be isolated to image tag URL parsing (doesn't seem to be affected by normal URLs). puts RedCloth.new('!../../index.html!').to_html Returns:

It trims the any number dots before the first / in relative URL's. I kind of depend on this as the code I'm generating is part of a publishing system that needs to be able to handle relative links so pages can be distributed offline. On a side note, congrats Jason on the rewrite! Will it be long before this new version becomes standard? Cheers Jase. From jason at hybd.net Sat Apr 12 18:59:27 2008 From: jason at hybd.net (Jase) Date: Sat, 12 Apr 2008 23:59:27 +0100 Subject: Another possible bug... Message-ID: <1208041167.32050.5.camel@jase-ubuntu> This is to do with URL processing it appears to be isolated to image tag URL parsing (doesn't seem to be affected by normal URLs). puts RedCloth.new('!../../index.html!').to_html Returns:

It trims the any number dots before the first / in relative URL's. I kind of depend on this as the code I'm generating is part of a publishing system that needs to be able to handle relative links so pages can be distributed offline. On a side note, congrats Jason on the rewrite! Will it be long before this new version becomes standard? Cheers Jase. From jg at jasongarber.com Mon Apr 14 09:43:00 2008 From: jg at jasongarber.com (Jason Garber) Date: Mon, 14 Apr 2008 09:43:00 -0400 Subject: Another possible bug... In-Reply-To: <1208041555.32050.8.camel@jase-ubuntu> References: <1208041167.32050.5.camel@jase-ubuntu> <1208041555.32050.8.camel@jase-ubuntu> Message-ID: <2968F169-AB13-4ACA-BC47-181271086189@jasongarber.com> Textile allows for a dot there to end alignment/class/style for the image. RedCloth 3.0.4 and http://textile.thresholdstate.com/ both eat the first dot. > > RedCloth::VERSION > => "3.0.4" > > RedCloth.new("!../../image.jpg!").to_html > =>

Textile: !../../image.jpg! XHTML:

It appears that both intend to allow that dot only when it's followed by a space... RedCloth 3.0.4: > IMAGE_RE = / > (

|.|^) # start of line? > \! # opening > (\<|\=|\>)? # optional alignment atts > (#{C}) # optional style,class atts > (?:\. )? # optional dot-space > ([^\s(!]+?) # presume this is the src > \s? # optional space > (?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title > \! # closing > (?::#{ HYPERLINK })? # optional href > /x classTextile.php: > function image($text) > { > return preg_replace_callback("/ > (?:[[{])? # pre > \! # opening ! > (\<|\=|\>)?? # optional alignment atts > ($this->c) # optional style,class atts > (?:\. )? # optional dot-space > ([^\s(!]+) # presume this is the src > \s? # optional space > (?:\(([^\)]+)\))? # optional title > \! # closing > (?::(\S+))? # optional href > (?:[\]}]|(?=\s|$)) # lookahead: space or end of string > /Ux", array(&$this, "fImage"), $text); > } ... but it appears the classTextile.php author missed that that space would be ignored because of the the x (PCRE_EXTENDED) option (and RedCloth copied the mistake). Using this seems to fix it: > (?:\.\s)? # optional dot-space Is it better to implement it the "right" (intended) way or in a way that's backward-compatible? I'm going to do it "right" for now and we'll see how that works out. http://code.whytheluckystiff.net/redcloth/ticket/49 On Apr 12, 2008, at 7:05 PM, Jase wrote: > This is to do with URL processing it appears to be isolated to > image tag > URL parsing (doesn't seem to be affected by normal URLs). > > puts RedCloth.new('!../../index.html!').to_html > > Returns: > >

> > It trims the any number dots before the first / in relative URL's. I > kind of depend on this as the code I'm generating is part of a > publishing system that needs to be able to handle relative links so > pages can be distributed offline. > > On a side note, congrats Jason on the rewrite! Will it be long before > this new version becomes standard? > > Cheers > Jase. > > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080414/3f31e88e/attachment-0001.html From jason at hybd.net Mon Apr 14 15:00:41 2008 From: jason at hybd.net (Jase) Date: Mon, 14 Apr 2008 20:00:41 +0100 Subject: Another possible bug... In-Reply-To: <2968F169-AB13-4ACA-BC47-181271086189@jasongarber.com> References: <1208041167.32050.5.camel@jase-ubuntu> <1208041555.32050.8.camel@jase-ubuntu> <2968F169-AB13-4ACA-BC47-181271086189@jasongarber.com> Message-ID: <1208199641.16258.9.camel@jase-ubuntu> Excellent work! Many thanks. Can't believe I missed how easy it was (I was looking at the URL parsing rules without even stopping to realise there was a separate set of image parsing rules in the inline Ragel file). On a side note, I think I saw something in Trac relating to this, not sure if it's the same, but installing from instructions at http://code.whytheluckystiff.net/redcloth/wiki/SuperRedCloth don't quite work (for me at least on Linux) $ gem install redcloth --source http://code.whytheluckystiff.net Doesn't work before it needs to be spelt RedCloth still. $ svn co http://code.whytheluckystiff.net/svn/redcloth/trunk redcloth $ cd redcloth $ rake $ rake gem $ gem install pkg/redcloth-3.###.gem Also doesn't work because it moans about something in the Rakefile on line 176. I had to change the platform from WIN32 to CURRENT. Seemed to work after that, though I dunno if it screws up compiling on WIN32 now (Not that I care much for Windows personally!) Anyway, once again thanks for the quick response. Jase On Mon, 2008-04-14 at 09:43 -0400, Jason Garber wrote: > Textile allows for a dot there to end alignment/class/style for the > image. RedCloth 3.0.4 and http://textile.thresholdstate.com/ both eat > the first dot. > > > > > RedCloth::VERSION=> "3.0.4"> > > RedCloth.new("!../../image.jpg!").to_html=>

> src="./../image.jpg" alt="" />

> > Textile: > !../../image.jpg! > XHTML: >

> > It appears that both intend to allow that dot only when it's followed > by a space... > RedCloth 3.0.4: > > IMAGE_RE = / (

|.|^) # start of line? > > \! # opening (\<|\=|\>)? > > # optional alignment atts (#{C}) # > > optional style,class atts (?:\. )? # optional > > dot-space ([^\s(!]+?) # presume this is the > > src \s? # optional space (?: > > \(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title \! > > # closing (?::#{ HYPERLINK })? # optional href /x > > > classTextile.php: > > function image($text) { return > > preg_replace_callback("/ (?:[[{])? # pre > > \! # opening ! (\<|\=|\>)?? # > > optional alignment atts ($this->c) # optional > > style,class atts (?:\. )? # optional > > dot-space ([^\s(!]+) # presume this is the src > > \s? # optional space (?:\(([^ > > \)]+)\))? # optional title \! # > > closing (?::(\S+))? # optional href > > (?:[\]}]|(?=\s|$)) # lookahead: space or end of string /Ux", > > array(&$this, "fImage"), $text); } > > > ... but it appears the classTextile.php author missed that that space > would be ignored because of the the x (PCRE_EXTENDED) option (and > RedCloth copied the mistake). Using this seems to fix it: > > > (?:\.\s)? # optional dot-space > > > Is it better to implement it the "right" (intended) way or in a way > that's backward-compatible? > > > I'm going to do it "right" for now and we'll see how that works out. > > > http://code.whytheluckystiff.net/redcloth/ticket/49 > > > > > On Apr 12, 2008, at 7:05 PM, Jase wrote: > > This is to do with URL processing it appears to be isolated to image > > tag > > URL parsing (doesn't seem to be affected by normal URLs). > > > > > > puts RedCloth.new('!../../index.html!').to_html > > > > > > Returns: > > > > > >

> > > > > > It trims the any number dots before the first / in relative URL's. I > > kind of depend on this as the code I'm generating is part of a > > publishing system that needs to be able to handle relative links so > > pages can be distributed offline. > > > > > > On a side note, congrats Jason on the rewrite! Will it be long > > before > > this new version becomes standard? > > > > > > Cheers > > Jase. > > > > > > > > > > _______________________________________________ > > Redcloth-upwards mailing list > > Redcloth-upwards at rubyforge.org > > http://rubyforge.org/mailman/listinfo/redcloth-upwards > > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From lists at ruby-forum.com Mon Apr 14 16:33:01 2008 From: lists at ruby-forum.com (James King) Date: Mon, 14 Apr 2008 22:33:01 +0200 Subject: Customising HTML output in SuperRedcloth? Message-ID: <81b9f3e353220a48841311d1c71b6229@ruby-forum.com> I have been using the technique outlined in this post by Geoffrey Grosenbach to extend RedCloth to output customised HTML markup. http://nubyonrails.com/articles/about-this-blog-custom-textile With the newer builds of the RedCloth gem, I'm using v3.290, this technique doesn't seem to work: # Using RedCloth version 3.274 require 'RedCloth' => true class YellowCloth < RedCloth def textile_ruby( tag, atts, cite, content ) %(
#{content}
) end end => nil YellowCloth.new(?ruby. def blah()?).to_html => ?

ruby. def blah()

? (This example is taken from one of the comments on Geoffrey's post.) I'm assuming that this is because the latest version is a significant rewrite of RedCloth and isn't as easily extensible in the same way? If so, does anyone know of an alternate technique to extend the latest version to output customised HTML markup? -- Posted via http://www.ruby-forum.com/. From jg at jasongarber.com Mon Apr 14 16:42:25 2008 From: jg at jasongarber.com (Jason Garber) Date: Mon, 14 Apr 2008 16:42:25 -0400 Subject: Another possible bug... In-Reply-To: <1208199641.16258.9.camel@jase-ubuntu> References: <1208041167.32050.5.camel@jase-ubuntu> <1208041555.32050.8.camel@jase-ubuntu> <2968F169-AB13-4ACA-BC47-181271086189@jasongarber.com> <1208199641.16258.9.camel@jase-ubuntu> Message-ID: <373E7D6D-99F2-4292-9171-70D1E0C7D8AE@jasongarber.com> > Excellent work! Many thanks. Can't believe I missed how easy it was (I > was looking at the URL parsing rules without even stopping to realise > there was a separate set of image parsing rules in the inline Ragel > file). So glad you found this bug! > > On a side note, I think I saw something in Trac relating to this, not > sure if it's the same, but installing from instructions at > http://code.whytheluckystiff.net/redcloth/wiki/SuperRedCloth don't > quite > work (for me at least on Linux) You're right. Rubygem names are case sensitive. I've changed the wiki page. > > $ gem install redcloth --source http://code.whytheluckystiff.net > > Doesn't work before it needs to be spelt RedCloth still. > > $ svn co http://code.whytheluckystiff.net/svn/redcloth/trunk redcloth > $ cd redcloth > $ rake > $ rake gem > $ gem install pkg/redcloth-3.###.gem > > Also doesn't work because it moans about something in the Rakefile on > line 176. I had to change the platform from WIN32 to CURRENT. > Seemed to > work after that, though I dunno if it screws up compiling on WIN32 now > (Not that I care much for Windows personally!) Yes, this is a problem. I'd been switching it from WIN32 to CURRENT and _why switched it back a time or two, so I asked him about it and he needs it set to WIN32 to cross-compile to win32 from his linux machine. He must be running an older version of rubygems. We need to figure out how to cross-compile without an error under rubygems >= 1.0. Jason > > Anyway, once again thanks for the quick response. > Jase > > > On Mon, 2008-04-14 at 09:43 -0400, Jason Garber wrote: >> Textile allows for a dot there to end alignment/class/style for the >> image. RedCloth 3.0.4 and http://textile.thresholdstate.com/ both >> eat >> the first dot. >> >> >>>> RedCloth::VERSION=> "3.0.4"> >>> RedCloth.new("!../../image.jpg!").to_html=>

>> src="./../image.jpg" alt="" />

>> >> Textile: >> !../../image.jpg! >> XHTML: >>

>> >> It appears that both intend to allow that dot only when it's followed >> by a space... >> RedCloth 3.0.4: >>> IMAGE_RE = / (

|.|^) # start of line? >>> \! # opening (\<|\=|\>)? >>> # optional alignment atts (#{C}) # >>> optional style,class atts (?:\. )? # optional >>> dot-space ([^\s(!]+?) # presume this is the >>> src \s? # optional space (?: >>> \(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title \! >>> # closing (?::#{ HYPERLINK })? # optional href /x >> >> >> classTextile.php: >>> function image($text) { return >>> preg_replace_callback("/ (?:[[{])? # pre >>> \! # opening ! (\<|\=|\>)?? # >>> optional alignment atts ($this->c) # optional >>> style,class atts (?:\. )? # optional >>> dot-space ([^\s(!]+) # presume this is the src >>> \s? # optional space (?:\(([^ >>> \)]+)\))? # optional title \! # >>> closing (?::(\S+))? # optional href >>> (?:[\]}]|(?=\s|$)) # lookahead: space or end of string /Ux", >>> array(&$this, "fImage"), $text); } >> >> >> ... but it appears the classTextile.php author missed that that space >> would be ignored because of the the x (PCRE_EXTENDED) option (and >> RedCloth copied the mistake). Using this seems to fix it: >> >>> (?:\.\s)? # optional dot-space >> >> >> Is it better to implement it the "right" (intended) way or in a way >> that's backward-compatible? >> >> >> I'm going to do it "right" for now and we'll see how that works out. >> >> >> http://code.whytheluckystiff.net/redcloth/ticket/49 >> >> >> >> >> On Apr 12, 2008, at 7:05 PM, Jase wrote: >>> This is to do with URL processing it appears to be isolated to image >>> tag >>> URL parsing (doesn't seem to be affected by normal URLs). >>> >>> >>> puts RedCloth.new('!../../index.html!').to_html >>> >>> >>> Returns: >>> >>> >>>

>>> >>> >>> It trims the any number dots before the first / in relative URL's. I >>> kind of depend on this as the code I'm generating is part of a >>> publishing system that needs to be able to handle relative links so >>> pages can be distributed offline. >>> >>> >>> On a side note, congrats Jason on the rewrite! Will it be long >>> before >>> this new version becomes standard? >>> >>> >>> Cheers >>> Jase. >>> >>> >>> >>> >>> _______________________________________________ >>> Redcloth-upwards mailing list >>> Redcloth-upwards at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/redcloth-upwards >> >> >> _______________________________________________ >> Redcloth-upwards mailing list >> Redcloth-upwards at rubyforge.org >> http://rubyforge.org/mailman/listinfo/redcloth-upwards > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From jg at jasongarber.com Mon Apr 14 17:03:38 2008 From: jg at jasongarber.com (Jason Garber) Date: Mon, 14 Apr 2008 17:03:38 -0400 Subject: Roadmap to RedCloth 4.0 release Message-ID: There are a few things that need to get done before we release RedCloth 4.0: 1.) Resolve the WIN32 vs. CURRENT problem outlined in my reply to Jase. It needs to compile for individuals who have the latest RubyGems, but we also have to be able to cross-compile win32 binaries. _why, do you have any ideas? 2.) Find the right Ragel code style and C compiler flags for optimum speed and memory usage. Stephen, didn't you start working on a rake task to benchmark the options? How's that coming? 3.) Fix all the bugs. Ha ha. But seriously, there have been some pretty major bugs coming in this month and I'll feel better about releasing when it's better tested. I'm thinking I'll post to ruby- talk and say, "now's your chance to test your app with RedCloth before we release, you blindly gem up, and your site breaks." :-) 4.) Is there a way to make the gem case-insensitive? I see all kinds of posts where someone says "gem install redcloth" doesn't work (I even wrote it wrong on the wiki). If we make it lowercase, everything posted around the web with it uppercase will be wrong. Short of changing RubyGems itself, is there something we can do to make it work both ways? Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080414/39e90cc4/attachment.html From jg at jasongarber.com Mon Apr 14 17:13:24 2008 From: jg at jasongarber.com (Jason Garber) Date: Mon, 14 Apr 2008 17:13:24 -0400 Subject: Customising HTML output in SuperRedcloth? In-Reply-To: <81b9f3e353220a48841311d1c71b6229@ruby-forum.com> References: <81b9f3e353220a48841311d1c71b6229@ruby-forum.com> Message-ID: You can customize the HTML markup it outputs by opening the RedCloth::HTML class and overriding the method you want to change. The article describes defining new patterns, though, and since RedCloth is now using Ragel to look for patterns, it can't be extended at this point. If you come up with a way that it could be, though, please submit a patch! In lieu of editing RedCloth, you could extend it and then add a wrapper or method chain that would first parse and transform your custom patterns and pass the result to RedCloth. This RedCloth version is much better about not mangling HTML than previous versions. On Apr 14, 2008, at 4:33 PM, James King wrote: > I have been using the technique outlined in this post by Geoffrey > Grosenbach to extend RedCloth to output customised HTML markup. > > http://nubyonrails.com/articles/about-this-blog-custom-textile > > With the newer builds of the RedCloth gem, I'm using v3.290, this > technique doesn't seem to work: > > # Using RedCloth version 3.274 > > require 'RedCloth' > => true > > class YellowCloth < RedCloth > def textile_ruby( tag, atts, cite, content ) > %(
#{content}
) > end > end > => nil > > YellowCloth.new(?ruby. def blah()?).to_html > => ?

ruby. def blah()

? > > (This example is taken from one of the comments on Geoffrey's post.) > > I'm assuming that this is because the latest version is a significant > rewrite of RedCloth and isn't as easily extensible in the same way? > > If so, does anyone know of an alternate technique to extend the latest > version to output customised HTML markup? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From jg at jasongarber.com Mon Apr 14 17:40:54 2008 From: jg at jasongarber.com (Jason Garber) Date: Mon, 14 Apr 2008 17:40:54 -0400 Subject: Please weigh in to RubyGems developers! Message-ID: <48C4DA63-C804-4249-B672-848D538BFEC7@jasongarber.com> Eric evidently isn't willing to consider making gem names case- insensitive when you install, so I've asked for there to be a prompt if you type the gem name in the wrong case. If you've ever typed gem install redcloth and got "ERROR: could not find redcloth locally or in a repository," please go to this URL, log in, and say, "yes, great idea!" http://rubyforge.org/tracker/index.php? func=detail&aid=19525&group_id=126&atid=575 Hopefully with some community support we can get them to fix this problem. I think it will only make the problem *worse* to switch to a lowercase "redcloth" at this point. Then people might think they're getting the latest version, but they really get an old one just because they used the wrong case. Jason From lists at ruby-forum.com Mon Apr 14 17:42:37 2008 From: lists at ruby-forum.com (James King) Date: Mon, 14 Apr 2008 23:42:37 +0200 Subject: Customising HTML output in SuperRedcloth? In-Reply-To: References: <81b9f3e353220a48841311d1c71b6229@ruby-forum.com> Message-ID: Jason Garber wrote: > You can customize the HTML markup it outputs by opening the > RedCloth::HTML class and overriding the method you want to change. > The article describes defining new patterns, though, and since > RedCloth is now using Ragel to look for patterns, it can't be > extended at this point. If you come up with a way that it could be, > though, please submit a patch! > > In lieu of editing RedCloth, you could extend it and then add a > wrapper or method chain that would first parse and transform your > custom patterns and pass the result to RedCloth. This RedCloth > version is much better about not mangling HTML than previous versions. Thanks Jason, Your idea of pre-formatting the custom patterns before passing it off to RedCloth is very smart. Perhaps this is even preferable to trying to override RedCloth itself. The beauty of Textile is that you can drop down into HTML when the need arises, so it makes sense to send RedCloth a mixture of standard textile markup and more "special" HTML and just let RedCloth do its thing. I'd be interested if someone does come up with a way of customising RedCloth's HTML output (I'm no Ragel expert, so it won't be me!), but in the mean time I'm going to experiment with pre-parsing my custom markup into HTML before sending it to RedCloth. Good stuff! -- Posted via http://www.ruby-forum.com/. From jason at hybd.net Mon Apr 14 18:38:51 2008 From: jason at hybd.net (Jase) Date: Mon, 14 Apr 2008 23:38:51 +0100 Subject: Customising HTML output in SuperRedcloth? In-Reply-To: References: <81b9f3e353220a48841311d1c71b6229@ruby-forum.com> Message-ID: <1208212731.22571.22.camel@jase-ubuntu> On Mon, 2008-04-14 at 23:42 +0200, James King wrote: > Jason Garber wrote: > > You can customize the HTML markup it outputs by opening the > > RedCloth::HTML class and overriding the method you want to change. > > The article describes defining new patterns, though, and since > > RedCloth is now using Ragel to look for patterns, it can't be > > extended at this point. If you come up with a way that it could be, > > though, please submit a patch! > > > > In lieu of editing RedCloth, you could extend it and then add a > > wrapper or method chain that would first parse and transform your > > custom patterns and pass the result to RedCloth. This RedCloth > > version is much better about not mangling HTML than previous versions. > > > Thanks Jason, I think a number of people are exploiting the ability to patch in their own extra commands. It would probably worth clearly documenting this significant architectural change when the release is out just to make it clear to others. > > Your idea of pre-formatting the custom patterns before passing it off to > RedCloth is very smart. Perhaps this is even preferable to trying to > override RedCloth itself. The beauty of Textile is that you can drop > down into HTML when the need arises, so it makes sense to send RedCloth > a mixture of standard textile markup and more "special" HTML and just > let RedCloth do its thing. > Again, I want to do something similar. I'm writing a publishing system for a few personal projects, and like Jason suggested, I'm using a wrapper method to do any custom processing either before or after. While it might be obvious to some, you might want to be aware of a few points: if you want to have custom block elements, you probably want to process these before sending to RedCloth (rather than after). This way any content inside the block item is escaped properly by the respective formatter (whether it be escaping HTML entities, or escaping things like back slashes in you are using LaTeX). Inline elements probably want to be done afterwards, as you probably don't have formatter escaping issues. I think there is a tag. You can wrap this round block elements before sending to RedCloth if you have preprocessed the content and don't want RedCloth to accidentally interpret something if it clashes. > I'd be interested if someone does come up with a way of customising > RedCloth's HTML output (I'm no Ragel expert, so it won't be me!), but in > the mean time I'm going to experiment with pre-parsing my custom markup > into HTML before sending it to RedCloth. > > Good stuff! From why at hobix.com Mon Apr 14 18:50:57 2008 From: why at hobix.com (_why) Date: Mon, 14 Apr 2008 17:50:57 -0500 Subject: Roadmap to RedCloth 4.0 release In-Reply-To: References: Message-ID: <20080414225057.GE60721@beekeeper.hobix.com> On Mon, Apr 14, 2008 at 05:03:38PM -0400, Jason Garber wrote: > 1.) Resolve the WIN32 vs. CURRENT problem outlined in my reply to Jase. It > needs to compile for individuals who have the latest RubyGems, but we also > have to be able to cross-compile win32 binaries. _why, do you have any > ideas? I think the correct setting to use in the Rakefile is the string 'mswin32'. I read though lib/rubygems/platform.rb and lib/rubygems/specification.rb in the latest release and they've only deprecated the use of the Gem::Platform constants, not done away with platform-specific gems in general. So, I think the line should be: s.platform = 'mswin32'. Give it a try in your Rakefile, Jason, and we'll take it from there. _why From why at hobix.com Mon Apr 14 18:52:03 2008 From: why at hobix.com (_why) Date: Mon, 14 Apr 2008 17:52:03 -0500 Subject: Roadmap to RedCloth 4.0 release In-Reply-To: References: Message-ID: <20080414225203.GF60721@beekeeper.hobix.com> On Mon, Apr 14, 2008 at 05:03:38PM -0400, Jason Garber wrote: > 4.) Is there a way to make the gem case-insensitive? I see all kinds of > posts where someone says "gem install redcloth" doesn't work (I even wrote > it wrong on the wiki). If we make it lowercase, everything posted around > the web with it uppercase will be wrong. Short of changing RubyGems > itself, is there something we can do to make it work both ways? It might be acceptable to release the gem with both casing until the old casing dies off. _why From gaspard at teti.ch Tue Apr 15 05:25:20 2008 From: gaspard at teti.ch (Gaspard Bucher) Date: Tue, 15 Apr 2008 11:25:20 +0200 Subject: Roadmap to RedCloth 4.0 release In-Reply-To: <20080414225203.GF60721@beekeeper.hobix.com> References: <20080414225203.GF60721@beekeeper.hobix.com> Message-ID: <7a9f744a0804150225m464bea38uf973d3f350f7a59e@mail.gmail.com> So the official gem would be "redcloth" and "RedCloth" would be deprecated ? I like this. It could event be RedCloth = 3.x with bug fixes (display a warning on installation "use 'redcloth' instead of 'RedCloth' for the new gem"), "redcloth" is 4.x ->.. This has the advantage that people have to make a move to use the new gem and I think this is good since it is a big jump. And in 2 years, "RedCloth" stops installing and just displays the message. G. On Tue, Apr 15, 2008 at 12:52 AM, _why wrote: > On Mon, Apr 14, 2008 at 05:03:38PM -0400, Jason Garber wrote: > > > 4.) Is there a way to make the gem case-insensitive? I see all kinds of > > posts where someone says "gem install redcloth" doesn't work (I even wrote > > it wrong on the wiki). If we make it lowercase, everything posted around > > the web with it uppercase will be wrong. Short of changing RubyGems > > itself, is there something we can do to make it work both ways? > > It might be acceptable to release the gem with both casing until the > old casing dies off. > > > > _why > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards > From jg at jasongarber.com Tue Apr 15 08:16:34 2008 From: jg at jasongarber.com (Jason Garber) Date: Tue, 15 Apr 2008 08:16:34 -0400 Subject: Roadmap to RedCloth 4.0 release In-Reply-To: <7a9f744a0804150225m464bea38uf973d3f350f7a59e@mail.gmail.com> References: <20080414225203.GF60721@beekeeper.hobix.com> <7a9f744a0804150225m464bea38uf973d3f350f7a59e@mail.gmail.com> Message-ID: <1B79ED6B-2B9B-4F33-AC95-B69933D11BE3@jasongarber.com> On Apr 15, 2008, at 5:25 AM, Gaspard Bucher wrote: > It could event be RedCloth = 3.x with bug fixes (display a warning on > installation "use 'redcloth' instead of 'RedCloth' for the new gem"), > "redcloth" is 4.x ->.. Hmm, I rather like this idea. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080415/153b31a8/attachment.html From jg at jasongarber.com Thu Apr 17 08:07:17 2008 From: jg at jasongarber.com (Jason Garber) Date: Thu, 17 Apr 2008 08:07:17 -0400 Subject: redcloth_scan.so problems In-Reply-To: <47F42982.7000501@ucla.edu> References: <47F42982.7000501@ucla.edu> Message-ID: <1D4FB034-22D7-4ADE-B8E0-77B5A58FD615@jasongarber.com> Justin, did you get your problem figured out? Is this how you always deploy compiled things? What platform/architecture is the machine you're compiling on and what is the server? On Apr 2, 2008, at 8:49 PM, Justin Collins wrote: > Hi all, > > I am trying to update my application to use the newest RedCloth > (3.274). > To do so, I have to compile it on one machine and then copy it over to > the server. This has worked fine in the past, but with the latest > RedCloth I'm getting a floating point exception and it crashes. > > Any advice on how to proceed/debug/figure out what's going wrong? > > Thanks, > Justin > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From justincollins at ucla.edu Thu Apr 17 14:49:15 2008 From: justincollins at ucla.edu (Justin Collins) Date: Thu, 17 Apr 2008 11:49:15 -0700 Subject: redcloth_scan.so problems In-Reply-To: <1D4FB034-22D7-4ADE-B8E0-77B5A58FD615@jasongarber.com> References: <47F42982.7000501@ucla.edu> <1D4FB034-22D7-4ADE-B8E0-77B5A58FD615@jasongarber.com> Message-ID: <48079BAB.2050807@ucla.edu> Hi Jason, No, I did not figure it out. Since it looks like Redcloth is still in flux, I thought maybe it is better to wait. However, I'm still open to suggestions! I'm not really familiar with troubleshooting this kind of problem. I have used the exact same method to get eruby and an older version of SuperRedCloth onto the server. It's shared hosting, so while I can run gcc, I get strange out of memory errors, making compiling on the server not an option. Both the machines are running x86 Linux. The 3.274 version of SuperRedCloth is working fine on the server. Thanks, Justin Jason Garber wrote: > Justin, did you get your problem figured out? Is this how you always > deploy compiled things? What platform/architecture is the machine > you're compiling on and what is the server? > > On Apr 2, 2008, at 8:49 PM, Justin Collins wrote: > > >> Hi all, >> >> I am trying to update my application to use the newest RedCloth >> (3.274). >> To do so, I have to compile it on one machine and then copy it over to >> the server. This has worked fine in the past, but with the latest >> RedCloth I'm getting a floating point exception and it crashes. >> >> Any advice on how to proceed/debug/figure out what's going wrong? >> >> Thanks, >> Justin >> _______________________________________________ >> Redcloth-upwards mailing list >> Redcloth-upwards at rubyforge.org >> http://rubyforge.org/mailman/listinfo/redcloth-upwards >> > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards > From jg at jasongarber.com Thu Apr 17 16:20:05 2008 From: jg at jasongarber.com (Jason Garber) Date: Thu, 17 Apr 2008 16:20:05 -0400 Subject: redcloth_scan.so problems In-Reply-To: <48079BAB.2050807@ucla.edu> References: <47F42982.7000501@ucla.edu> <1D4FB034-22D7-4ADE-B8E0-77B5A58FD615@jasongarber.com> <48079BAB.2050807@ucla.edu> Message-ID: Ooh. Shared hosting. I did that once. :-) Who's the host? We might see if we can get them to compile it for us. They'll certainly want to have RedCloth installed after we release, so perhaps they'd be willing to test it now. Tell me who and I'll email them. Thanks, Jason On Apr 17, 2008, at 2:49 PM, Justin Collins wrote: > Hi Jason, > > No, I did not figure it out. Since it looks like Redcloth is still in > flux, I thought maybe it is better to wait. However, I'm still open to > suggestions! I'm not really familiar with troubleshooting this kind of > problem. > > I have used the exact same method to get eruby and an older version of > SuperRedCloth onto the server. It's shared hosting, so while I can run > gcc, I get strange out of memory errors, making compiling on the > server > not an option. > > Both the machines are running x86 Linux. The 3.274 version of > SuperRedCloth is working fine on the server. > > Thanks, > Justin > > > > Jason Garber wrote: >> Justin, did you get your problem figured out? Is this how you always >> deploy compiled things? What platform/architecture is the machine >> you're compiling on and what is the server? >> >> On Apr 2, 2008, at 8:49 PM, Justin Collins wrote: >> >> >>> Hi all, >>> >>> I am trying to update my application to use the newest RedCloth >>> (3.274). >>> To do so, I have to compile it on one machine and then copy it >>> over to >>> the server. This has worked fine in the past, but with the latest >>> RedCloth I'm getting a floating point exception and it crashes. >>> >>> Any advice on how to proceed/debug/figure out what's going wrong? >>> >>> Thanks, >>> Justin >>> _______________________________________________ >>> Redcloth-upwards mailing list >>> Redcloth-upwards at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/redcloth-upwards >>> >> >> _______________________________________________ >> Redcloth-upwards mailing list >> Redcloth-upwards at rubyforge.org >> http://rubyforge.org/mailman/listinfo/redcloth-upwards >> > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From justincollins at ucla.edu Thu Apr 17 17:11:23 2008 From: justincollins at ucla.edu (Justin Collins) Date: Thu, 17 Apr 2008 14:11:23 -0700 Subject: redcloth_scan.so problems In-Reply-To: References: <47F42982.7000501@ucla.edu> <1D4FB034-22D7-4ADE-B8E0-77B5A58FD615@jasongarber.com> <48079BAB.2050807@ucla.edu> Message-ID: <4807BCFB.40607@ucla.edu> The provider is Site5: www.site5.com Jason Garber wrote: > Ooh. Shared hosting. I did that once. :-) > > Who's the host? We might see if we can get them to compile it for > us. They'll certainly want to have RedCloth installed after we > release, so perhaps they'd be willing to test it now. Tell me who > and I'll email them. > > Thanks, > Jason > > On Apr 17, 2008, at 2:49 PM, Justin Collins wrote: > > >> Hi Jason, >> >> No, I did not figure it out. Since it looks like Redcloth is still in >> flux, I thought maybe it is better to wait. However, I'm still open to >> suggestions! I'm not really familiar with troubleshooting this kind of >> problem. >> >> I have used the exact same method to get eruby and an older version of >> SuperRedCloth onto the server. It's shared hosting, so while I can run >> gcc, I get strange out of memory errors, making compiling on the >> server >> not an option. >> >> Both the machines are running x86 Linux. The 3.274 version of >> SuperRedCloth is working fine on the server. >> >> Thanks, >> Justin >> >> >> >> Jason Garber wrote: >> >>> Justin, did you get your problem figured out? Is this how you always >>> deploy compiled things? What platform/architecture is the machine >>> you're compiling on and what is the server? >>> >>> On Apr 2, 2008, at 8:49 PM, Justin Collins wrote: >>> >>> >>> >>>> Hi all, >>>> >>>> I am trying to update my application to use the newest RedCloth >>>> (3.274). >>>> To do so, I have to compile it on one machine and then copy it >>>> over to >>>> the server. This has worked fine in the past, but with the latest >>>> RedCloth I'm getting a floating point exception and it crashes. >>>> >>>> Any advice on how to proceed/debug/figure out what's going wrong? >>>> >>>> Thanks, >>>> Justin >>>> _______________________________________________ >>>> Redcloth-upwards mailing list >>>> Redcloth-upwards at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/redcloth-upwards >>>> >>>> >>> _______________________________________________ >>> Redcloth-upwards mailing list >>> Redcloth-upwards at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/redcloth-upwards >>> >>> >> _______________________________________________ >> Redcloth-upwards mailing list >> Redcloth-upwards at rubyforge.org >> http://rubyforge.org/mailman/listinfo/redcloth-upwards >> > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards > From jason at hybd.net Thu Apr 17 18:57:39 2008 From: jason at hybd.net (Jase) Date: Thu, 17 Apr 2008 23:57:39 +0100 Subject: redcloth_scan.so problems In-Reply-To: References: <47F42982.7000501@ucla.edu> <1D4FB034-22D7-4ADE-B8E0-77B5A58FD615@jasongarber.com> <48079BAB.2050807@ucla.edu> Message-ID: <1208473059.32061.15.camel@jase-ubuntu> I'm guessing that large C file Ragel generates is partly the issue here (It's about a Mb in size). I seem to recall someone else a while back saying they had similar errors due to stack space or memory at http://rubyforge.org/pipermail/redcloth-upwards/2008-March/000190.html I know the -O0 patch was supposed to prevent this to some degree. I'm wondering if there is an ability to break down the Ragel generated code over several source files. While I'm not a C expert, I'm sure it would be better in the long run than using -O0, and would make compiling a lot less painful for those with limited memory / CPU and to me using specific compiler flags does feel a tad hacky. I don't know what the memory usage is like on compiling, but I can only think a lot of the people who are using cheapy low end VPS's (Like I used to) would have issues if they only have 96-128Mb and a small swap partition (I've noticed VPS's seem to allocate swap space proportional to RAM, and not everyone will be wise enough to realise it's possible to extend the swap space by using a swap file over a loop-back block device, or cross compile etc) These are just some gut feelings I have at the moment regarding compiling. Like I say though, I'm not an expert with C, so my suggestion probably needs to be taken with a large pinch of salt, not to mention I'm guessing in somewhat what I've said might have crossed your minds too. Jase On Thu, 2008-04-17 at 16:20 -0400, Jason Garber wrote: > Ooh. Shared hosting. I did that once. :-) > > Who's the host? We might see if we can get them to compile it for > us. They'll certainly want to have RedCloth installed after we > release, so perhaps they'd be willing to test it now. Tell me who > and I'll email them. > > Thanks, > Jason > > On Apr 17, 2008, at 2:49 PM, Justin Collins wrote: > > > Hi Jason, > > > > No, I did not figure it out. Since it looks like Redcloth is still in > > flux, I thought maybe it is better to wait. However, I'm still open to > > suggestions! I'm not really familiar with troubleshooting this kind of > > problem. > > > > I have used the exact same method to get eruby and an older version of > > SuperRedCloth onto the server. It's shared hosting, so while I can run > > gcc, I get strange out of memory errors, making compiling on the > > server > > not an option. > > > > Both the machines are running x86 Linux. The 3.274 version of > > SuperRedCloth is working fine on the server. > > > > Thanks, > > Justin > > > > > > > > Jason Garber wrote: > >> Justin, did you get your problem figured out? Is this how you always > >> deploy compiled things? What platform/architecture is the machine > >> you're compiling on and what is the server? > >> > >> On Apr 2, 2008, at 8:49 PM, Justin Collins wrote: > >> > >> > >>> Hi all, > >>> > >>> I am trying to update my application to use the newest RedCloth > >>> (3.274). > >>> To do so, I have to compile it on one machine and then copy it > >>> over to > >>> the server. This has worked fine in the past, but with the latest > >>> RedCloth I'm getting a floating point exception and it crashes. > >>> > >>> Any advice on how to proceed/debug/figure out what's going wrong? > >>> > >>> Thanks, > >>> Justin > >>> _______________________________________________ > >>> Redcloth-upwards mailing list > >>> Redcloth-upwards at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/redcloth-upwards > >>> > >> > >> _______________________________________________ > >> Redcloth-upwards mailing list > >> Redcloth-upwards at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/redcloth-upwards > >> > > > > _______________________________________________ > > Redcloth-upwards mailing list > > Redcloth-upwards at rubyforge.org > > http://rubyforge.org/mailman/listinfo/redcloth-upwards > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From jg at jasongarber.com Fri Apr 18 17:36:46 2008 From: jg at jasongarber.com (Jason Garber) Date: Fri, 18 Apr 2008 17:36:46 -0400 Subject: Benchmarking, performance tweaks Message-ID: <22AE349A-C0B6-4CB9-BA0F-8E932FC0EE38@jasongarber.com> Hey, I did some benchmarking of RedCloth and changed the Ragel code generation style to one that will use 14.6 MB of memory when you compile rather than the 391MB it was using before. It compiles faster and the compiled file is smaller now too (about 223K). A nice milestone as we commit revision [300]! Jason name compile_time compile_max_rss test_time test_max_rss ext_so_size T0 Table driven FSM (default) 21.57 14.67 3.45 17.85 223 T1 Faster table driven FSM 19.23 22.62 3.53 18.27 286 F1 Faster flat table-driven FSM 19.26 45.62 3.1 17.98 649 F0 Flat table driven FSM 20.1 45.69 3.45 18.43 585 G0 Goto-driven FSM 26.38 104.26 3.38 18.58 1103 G1 Faster goto-driven FSM 27.12 160.25 3.4 18.65 1194 G2 Really fast goto-driven FSM 75.3 391.06 3.33 18.14 2100 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080418/36947e4d/attachment.html From jason at hybd.net Fri Apr 18 17:49:49 2008 From: jason at hybd.net (Jase) Date: Fri, 18 Apr 2008 22:49:49 +0100 Subject: Benchmarking, performance tweaks In-Reply-To: <22AE349A-C0B6-4CB9-BA0F-8E932FC0EE38@jasongarber.com> References: <22AE349A-C0B6-4CB9-BA0F-8E932FC0EE38@jasongarber.com> Message-ID: <1208555389.15714.1.camel@jase-ubuntu> Great work :-) Some really significant improvement there! On Fri, 2008-04-18 at 17:36 -0400, Jason Garber wrote: > Hey, I did some benchmarking of RedCloth and changed the Ragel code > generation style to one that will use 14.6 MB of memory when you > compile rather than the 391MB it was using before. It compiles faster > and the compiled file is smaller now too (about 223K). A nice > milestone as we commit revision [300]! > Jason > > name > compile_time > compile_max_rss > test_time > test_max_rss > ext_so_size > > > > T0 > Table > driven > FSM > (default) > 21.57 > 14.67 > 3.45 > 17.85 > 223 > > > > T1 > Faster > table > driven > FSM > 19.23 > 22.62 > 3.53 > 18.27 > 286 > > > > F1 > Faster > flat > table-driven FSM > 19.26 > 45.62 > 3.1 > 17.98 > 649 > > > > F0 Flat > table > driven > FSM > 20.1 > 45.69 > 3.45 > 18.43 > 585 > > > > G0 > Goto-driven FSM > 26.38 > 104.26 > 3.38 > 18.58 > 1103 > > > > G1 > Faster > goto-driven FSM > 27.12 > 160.25 > 3.4 > 18.65 > 1194 > > > > G2 > Really > fast > goto-driven FSM > 75.3 > 391.06 > 3.33 > 18.14 > 2100 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From lists at ruby-forum.com Wed Apr 23 15:56:09 2008 From: lists at ruby-forum.com (Cayce Balara) Date: Wed, 23 Apr 2008 21:56:09 +0200 Subject: Strip out RedCloth markup? Message-ID: <61d0c437ffa0621e0462c46f6a6ba3e6@ruby-forum.com> Is there a way in RedCloth to go from text with Textile markup in it to plain text without the markup? Not just
 or  that passes
it through, but actually strips out the textile markup glyphs so
something like

*word*

ends up just being

word

in the output?

thanks.
-- 
Posted via http://www.ruby-forum.com/.

From jg at jasongarber.com  Wed Apr 23 16:25:38 2008
From: jg at jasongarber.com (Jason Garber)
Date: Wed, 23 Apr 2008 16:25:38 -0400
Subject: Strip out RedCloth markup?
In-Reply-To: <61d0c437ffa0621e0462c46f6a6ba3e6@ruby-forum.com>
References: <61d0c437ffa0621e0462c46f6a6ba3e6@ruby-forum.com>
Message-ID: <981F5E89-E3FB-4537-B94C-3EC8FFDE8C6A@jasongarber.com>

No, not currently.  You could write a plain text formatter like the  
HTML formatter in (the forthcoming) RedCloth 4.0.  Then you rewrite  
the methods so it passes through the text you want but doesn't add HTML.

If you want to hack on it, fork the project on github and let me know  
when you have something interesting.

Out of curiousity, what are you using this for?

On Apr 23, 2008, at 3:56 PM, Cayce Balara wrote:

> Is there a way in RedCloth to go from text with Textile markup in  
> it to
> plain text without the markup? Not just 
 or  that  
> passes
> it through, but actually strips out the textile markup glyphs so
> something like
>
> *word*
>
> ends up just being
>
> word
>
> in the output?
>
> thanks.
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080423/59029a06/attachment-0001.html 

From lists at ruby-forum.com  Wed Apr 23 22:08:22 2008
From: lists at ruby-forum.com (Cayce Balara)
Date: Thu, 24 Apr 2008 04:08:22 +0200
Subject: Strip out RedCloth markup?
In-Reply-To: <981F5E89-E3FB-4537-B94C-3EC8FFDE8C6A@jasongarber.com>
References: <61d0c437ffa0621e0462c46f6a6ba3e6@ruby-forum.com>
	<981F5E89-E3FB-4537-B94C-3EC8FFDE8C6A@jasongarber.com>
Message-ID: <4e9babf21204bd0f777d2a1fa63d9d63@ruby-forum.com>

The site I'm working on has a batch email function and I'd like the user 
to be able to user Textile for creating their HTML formatted email. 
However, I've set up action mailer to do multipart emails in case 
recipient is on a plain text client. So, for the HTML mailer template I 
use the .to_html output for the body text, and for the plain text mailer 
template I want to strip out the markup.

Right now I'm just sending through the marked up text, which isn't 
horrible if you keep it simple, but links, for instance, really come 
through badly.

Thanks for the input.
-- 
Posted via http://www.ruby-forum.com/.

From jg at jasongarber.com  Thu Apr 24 09:17:22 2008
From: jg at jasongarber.com (Jason Garber)
Date: Thu, 24 Apr 2008 09:17:22 -0400
Subject: Strip out RedCloth markup?
In-Reply-To: <4e9babf21204bd0f777d2a1fa63d9d63@ruby-forum.com>
References: <61d0c437ffa0621e0462c46f6a6ba3e6@ruby-forum.com>
	<981F5E89-E3FB-4537-B94C-3EC8FFDE8C6A@jasongarber.com>
	<4e9babf21204bd0f777d2a1fa63d9d63@ruby-forum.com>
Message-ID: 

Okay, that's what I suspected.  I have had that need at times too.   
Maybe it would be nice, instead of just outputting the text with no  
formatting, to do a little plain text formatting exclusively for  
human consumption (unlike Textile or Markdown).  Like:

Header 1
=======

This is a link (http://code.whytheluckystiff.net/redcloth) and  
perhaps some *bold* text.

Now, you specifically *didn't* want the asterisks around bold  
phrases, didn't you?  What do you think?


On Apr 23, 2008, at 10:08 PM, Cayce Balara wrote:

> The site I'm working on has a batch email function and I'd like the  
> user
> to be able to user Textile for creating their HTML formatted email.
> However, I've set up action mailer to do multipart emails in case
> recipient is on a plain text client. So, for the HTML mailer  
> template I
> use the .to_html output for the body text, and for the plain text  
> mailer
> template I want to strip out the markup.
>
> Right now I'm just sending through the marked up text, which isn't
> horrible if you keep it simple, but links, for instance, really come
> through badly.
>
> Thanks for the input.
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards


From lists at ruby-forum.com  Thu Apr 24 10:59:45 2008
From: lists at ruby-forum.com (Cayce Balara)
Date: Thu, 24 Apr 2008 16:59:45 +0200
Subject: Strip out RedCloth markup?
In-Reply-To: 
References: <61d0c437ffa0621e0462c46f6a6ba3e6@ruby-forum.com>
	<981F5E89-E3FB-4537-B94C-3EC8FFDE8C6A@jasongarber.com>
	<4e9babf21204bd0f777d2a1fa63d9d63@ruby-forum.com>
	
Message-ID: 

Not so much _I_ didn't want the asterisks, but client does not like the 
output that way.

I think I see what you're getting at, though - would this be a matter of 
setting up custom RedCloth rules to apply the "plain text" formatting 
they want to end up with, and then perhaps a custom method to apply 
those rules instead of the normal ones, such as ".to_plain_formatted"?
-- 
Posted via http://www.ruby-forum.com/.

From jg at jasongarber.com  Thu Apr 24 11:35:36 2008
From: jg at jasongarber.com (Jason Garber)
Date: Thu, 24 Apr 2008 11:35:36 -0400
Subject: Strip out RedCloth markup?
In-Reply-To: 
References: <61d0c437ffa0621e0462c46f6a6ba3e6@ruby-forum.com>
	<981F5E89-E3FB-4537-B94C-3EC8FFDE8C6A@jasongarber.com>
	<4e9babf21204bd0f777d2a1fa63d9d63@ruby-forum.com>
	
	
Message-ID: <75B1A794-6EA5-45BD-B3CE-2E4C1362EFF7@jasongarber.com>

Exactly.  See the LaTeX formatter someone added and do likewise.

On Apr 24, 2008, at 10:59 AM, Cayce Balara wrote:

> Not so much _I_ didn't want the asterisks, but client does not like  
> the
> output that way.
>
> I think I see what you're getting at, though - would this be a  
> matter of
> setting up custom RedCloth rules to apply the "plain text" formatting
> they want to end up with, and then perhaps a custom method to apply
> those rules instead of the normal ones, such as ".to_plain_formatted"?
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards


From lists at ruby-forum.com  Thu Apr 24 12:19:07 2008
From: lists at ruby-forum.com (Cayce Balara)
Date: Thu, 24 Apr 2008 18:19:07 +0200
Subject: Strip out RedCloth markup?
In-Reply-To: <75B1A794-6EA5-45BD-B3CE-2E4C1362EFF7@jasongarber.com>
References: <61d0c437ffa0621e0462c46f6a6ba3e6@ruby-forum.com>
	<981F5E89-E3FB-4537-B94C-3EC8FFDE8C6A@jasongarber.com>
	<4e9babf21204bd0f777d2a1fa63d9d63@ruby-forum.com>
	
	
	<75B1A794-6EA5-45BD-B3CE-2E4C1362EFF7@jasongarber.com>
Message-ID: 

Jason Garber wrote:
> Exactly.  See the LaTeX formatter someone added and do likewise.

Coolio - will start working on that. Thanks for your help.
-- 
Posted via http://www.ruby-forum.com/.