From dougal.s at gmail.com Tue Dec 4 10:05:45 2007 From: dougal.s at gmail.com (Douglas F Shearer) Date: Tue, 4 Dec 2007 15:05:45 +0000 Subject: Bug: NoMethodError: private method `gsub' called for nil:NilClass Message-ID: Hi there. I'm using RedCloth as part of a social network's blog system. I came across the following bug when an img tag with the src attribute is inputted, and filter_html is set to true. I have pasted the code sample below. >> require 'RubyGems' => true >> require 'RedCloth' => true >> RedCloth.new('',[:filter_html]).to_html NoMethodError: private method `gsub' called for nil:NilClass from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1118:in `clean_html' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1113:in `each' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1113:in `clean_html' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1112:in `each' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1112:in `clean_html' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1107:in `gsub!' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1107:in `clean_html' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:310:in `to_html' from (irb):3 >> Thanks. Douglas F Shearer dougal.s at gmail.com http://douglasfshearer.com From johan at johansorensen.com Tue Dec 11 09:48:13 2007 From: johan at johansorensen.com (=?ISO-8859-1?Q?Johan_S=F8rensen?=) Date: Tue, 11 Dec 2007 15:48:13 +0100 Subject: Build issues on Leopard Message-ID: <9e0f31700712110648v4aed3163rfa0d0f870d6ea597@mail.gmail.com> Hello, I'm having some issues building r190 on Leopard (10.5.1): $ rake (in /Users/johan/temp/superredcloth) ragel superredcloth_scan.rl | rlgen-cd -G2 -o superredcloth_scan.c ragel superredcloth_inline.rl | rlgen-cd -G2 -o superredcloth_inline.c /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb checking for main() in -lc... yes creating Makefile make gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal- darwin9.0 -I. -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -c superredcloth_inline.c powerpc-apple-darwin9-gcc-4.0.1: Internal error: Segmentation fault (program cc1) Please submit a full bug report. See for instructions. i686-apple-darwin9-gcc-4.0.1: Internal error: Segmentation fault (program cc1) Please submit a full bug report. See for instructions. make: *** [superredcloth_inline.o] Error 1 rake aborted! Command failed with status (2): [make...] /Users/johan/temp/superredcloth/rakefile:129 (I tried removing the -arch ppc flags from the Makefile, still segfaults) $ ruby -v ruby 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0] $ ragel -v # (from macports) Ragel State Machine Compiler version 5.24 September 2007 Copyright (c) 2001-2007 by Adrian Thurston $ which gcc; gcc --version /usr/bin/gcc i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Anyone know what's up? Thanks, JS -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20071211/787922b2/attachment.html From johan at johansorensen.com Wed Dec 12 05:21:15 2007 From: johan at johansorensen.com (=?ISO-8859-1?Q?Johan_S=F8rensen?=) Date: Wed, 12 Dec 2007 11:21:15 +0100 Subject: Build issues on Leopard In-Reply-To: <9e0f31700712110648v4aed3163rfa0d0f870d6ea597@mail.gmail.com> References: <9e0f31700712110648v4aed3163rfa0d0f870d6ea597@mail.gmail.com> Message-ID: <9e0f31700712120221v85bda65hb2cf2a42d4874e91@mail.gmail.com> On 12/11/07, Johan S?rensen wrote: > > > > I'm having some issues building r190 on Leopard (10.5.1): > > > $ rake > (in /Users/johan/temp/superredcloth) > ragel superredcloth_scan.rl | rlgen-cd -G2 -o superredcloth_scan.c > ragel superredcloth_inline.rl | rlgen-cd -G2 -o superredcloth_inline.c > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby > extconf.rb > checking for main() in -lc... yes > creating Makefile > make > gcc -I. -I. > -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal- > darwin9.0 -I. -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -c > superredcloth_inline.c > powerpc-apple-darwin9-gcc-4.0.1: Internal error: Segmentation fault > (program cc1) > Please submit a full bug report. > See for instructions. > i686-apple-darwin9-gcc-4.0.1: Internal error: Segmentation fault (program > cc1) > Please submit a full bug report. > See for instructions. > make: *** [superredcloth_inline.o] Error 1 > rake aborted! > Command failed with status (2): [make...] > /Users/johan/temp/superredcloth/rakefile:129 > The solution here was to use the -O1 instead of the default (generated) -Os CFLAG. Here's a patch (there may be better ways to do this with mkmf?): Index: ext/superredcloth_scan/extconf.rb =================================================================== --- ext/superredcloth_scan/extconf.rb (revision 190) +++ ext/superredcloth_scan/extconf.rb (working copy) @@ -1,5 +1,10 @@ require 'mkmf' +if /darwin9/ =~ RUBY_PLATFORM + # OSX 10.5 doesn't like the default "-Os" + $CFLAGS << " -O1 " +end + dir_config("superredcloth_scan") have_library("c", "main") JS -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20071212/02b1cafc/attachment-0001.html From jg at jasongarber.com Wed Dec 12 17:07:35 2007 From: jg at jasongarber.com (Jason Garber) Date: Wed, 12 Dec 2007 17:07:35 -0500 Subject: Build issues on Leopard In-Reply-To: <9e0f31700712120221v85bda65hb2cf2a42d4874e91@mail.gmail.com> References: <9e0f31700712110648v4aed3163rfa0d0f870d6ea597@mail.gmail.com> <9e0f31700712120221v85bda65hb2cf2a42d4874e91@mail.gmail.com> Message-ID: Thanks! Patch applied. On Dec 12, 2007, at 5:21 AM, Johan S?rensen wrote: > > > On 12/11/07, Johan S?rensen wrote: > > > I'm having some issues building r190 on Leopard (10.5.1): > > > $ rake > (in /Users/johan/temp/superredcloth) > ragel superredcloth_scan.rl | rlgen-cd -G2 -o superredcloth_scan.c > ragel superredcloth_inline.rl | rlgen-cd -G2 -o superredcloth_inline.c > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby > extconf.rb > checking for main() in -lc... yes > creating Makefile > make > gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/ > 1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -fno-common -arch ppc > -arch i386 -Os -pipe -fno-common -c superredcloth_inline.c > powerpc-apple-darwin9-gcc-4.0.1: Internal error: Segmentation fault > (program cc1) > Please submit a full bug report. > See for instructions. > i686-apple-darwin9-gcc-4.0.1: Internal error: Segmentation fault > (program cc1) > Please submit a full bug report. > See for instructions. > make: *** [superredcloth_inline.o] Error 1 > rake aborted! > Command failed with status (2): [make...] > /Users/johan/temp/superredcloth/rakefile:129 > > The solution here was to use the -O1 instead of the default > (generated) -Os CFLAG. > > Here's a patch (there may be better ways to do this with mkmf?): > > Index: ext/superredcloth_scan/extconf.rb > =================================================================== > --- ext/superredcloth_scan/extconf.rb (revision 190) > +++ ext/superredcloth_scan/extconf.rb (working copy) > @@ -1,5 +1,10 @@ > require 'mkmf' > > +if /darwin9/ =~ RUBY_PLATFORM > + # OSX 10.5 doesn't like the default "-Os" > + $CFLAGS << " -O1 " > +end > + > dir_config("superredcloth_scan") > have_library("c", "main") > > > JS > > > > _______________________________________________ > 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/20071212/6494f641/attachment.html From jg at jasongarber.com Wed Dec 19 14:45:38 2007 From: jg at jasongarber.com (Jason Garber) Date: Wed, 19 Dec 2007 14:45:38 -0500 Subject: Convert all HTML entities within
 tags?
Message-ID: 

Textile 2.0.0:
bc. This is within a block of code, so < and > should be *entities*.   
You can talk about a 

tag if you wish and it will be properly escaped.

You can't make something actually bold within.
Output:
This is within a block of code, so < and > should be  
*entities*.  You can talk about a <p> tag if you wish and it  
will be properly escaped.
You can't make something actually <b>bold</b> within.
What do you all think? Is it better to automatically escape entities within blocks of code like Texile2 does (and SRC currently does not)? I'm wondering if we should allow entities within blocks of code to pass through SRC untouched.
bold
is valid HTML, but if it's automatically converted into
<b&:gt;...,  
there's no way to have tags inside your pre tag.  On the other hand,  
if we do that, you can't just paste in HTML and know it'll come out  
looking fine... you'll have to convert the entities yourself.

Which way should SuperRedCloth go?

Jason


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20071219/61010923/attachment.html