From jg at jasongarber.com Mon Jul 14 15:15:04 2008 From: jg at jasongarber.com (Jason Garber) Date: Mon, 14 Jul 2008 15:15:04 -0400 Subject: Ready to release? Message-ID: I think I'm ready to release RedCloth 4.0. Anyone have any objections? Should I tag the latest commit as RC1 or should we just go for it? It's pretty much a given that with as many changes as were made between 3.0.4 and 4.0 we overlooked something and will have to release 4.0.1 in short order. I'm sending _why the latest gems to put up on his gem server. Once they're up, see if there's anything you want fixed before the release. Jason From lists at ruby-forum.com Mon Jul 21 07:39:36 2008 From: lists at ruby-forum.com (Tekin Suleyman) Date: Mon, 21 Jul 2008 13:39:36 +0200 Subject: Ready to release? In-Reply-To: References: Message-ID: <66d26c8e2b179f66115b2daa765a29b0@ruby-forum.com> Hi Jason, Any update on the 4.0 release? It would be great to see all the hard work you've put in recently on why's gem server, and even on the github or rubygems servers too!? -- Posted via http://www.ruby-forum.com/. From why at hobix.com Mon Jul 21 10:39:54 2008 From: why at hobix.com (_why) Date: Mon, 21 Jul 2008 09:39:54 -0500 Subject: Ready to release? In-Reply-To: <66d26c8e2b179f66115b2daa765a29b0@ruby-forum.com> References: <66d26c8e2b179f66115b2daa765a29b0@ruby-forum.com> Message-ID: <20080721143954.GE49772@beekeeper.hobix.com> On Mon, Jul 21, 2008 at 01:39:36PM +0200, Tekin Suleyman wrote: > Any update on the 4.0 release? It would be great to see all the hard > work you've put in recently on why's gem server, and even on the github > or rubygems servers too!? I'll find some time for this today. I'm prepping Shoes for a big release at the end of the month and have another Shoes Day on Friday, so I'd like to hold off on the 4.0 release until August. You know, just in case there are problems and we have to do a 4.0.1 release, I want to be able to give it my complete attention. _why From lists at ruby-forum.com Mon Jul 21 12:09:54 2008 From: lists at ruby-forum.com (Tekin Suleyman) Date: Mon, 21 Jul 2008 18:09:54 +0200 Subject: Ready to release? In-Reply-To: <20080721143954.GE49772@beekeeper.hobix.com> References: <66d26c8e2b179f66115b2daa765a29b0@ruby-forum.com> <20080721143954.GE49772@beekeeper.hobix.com> Message-ID: <38156a5fb73535205bbb5854455831a6@ruby-forum.com> OK, thanks for the update. Wll you publish to rubyforge as well? It seems a shame that those that don't know better will be running 3.04! Tekin -- Posted via http://www.ruby-forum.com/. From jg at jasongarber.com Tue Jul 22 05:06:13 2008 From: jg at jasongarber.com (Jason Garber) Date: Tue, 22 Jul 2008 05:06:13 -0400 Subject: Ready to release? In-Reply-To: <20080721143954.GE49772@beekeeper.hobix.com> References: <66d26c8e2b179f66115b2daa765a29b0@ruby-forum.com> <20080721143954.GE49772@beekeeper.hobix.com> Message-ID: <65418AAA-D061-4CB4-8967-7053F659AB43@jasongarber.com> Whoops, sorry why. I just now checked my email and read your message, but I pushed 4.0 to RubyForge 12 hours ago. It was basically ready late last week, but I was waiting 'til Monday to release so I'd be online to fix any problems that arose and so I had time to do a final test on windows and linux. For announcement of the release, I thought I'd wait until Tuesday (today) so the gems were good and propagated. Hopefully there won't be any urgent problems that need your expertise. Thanks for wanting to be able to give it attention, though. On Jul 21, 2008, at 10:39 AM, _why wrote: > On Mon, Jul 21, 2008 at 01:39:36PM +0200, Tekin Suleyman wrote: >> Any update on the 4.0 release? It would be great to see all the hard >> work you've put in recently on why's gem server, and even on the >> github >> or rubygems servers too!? > > I'll find some time for this today. I'm prepping Shoes for a > big release at the end of the month and have another Shoes Day on > Friday, so I'd like to hold off on the 4.0 release until August. > > You know, just in case there are problems and we have to do a 4.0.1 > release, I want to be able to give it my complete attention. > > _why > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From jg at jasongarber.com Tue Jul 22 10:10:02 2008 From: jg at jasongarber.com (Jason Garber) Date: Tue, 22 Jul 2008 10:10:02 -0400 Subject: [ANN] Release of RedCloth 4.0.0 Message-ID: <608C8121-F051-41F5-97E1-4B0CCFD3A4DF@jasongarber.com> Though we've already mentioned it this morning, consider this the official announcement of RedCloth 4.0.0. It's available on RubyForge, so all you have to do to get it is gem install RedCloth (don't forget to make it CamelCase). Also, when I did a gem update RedCloth, I got an error, probably because we've never had to pick the platform before. A gem install RedCloth worked just fine for updating, though. I'd like to thank _why for starting the rewrite and then so freely giving up the reigns. It's surely not as good of code as if he'd written it all himself, but there it is, functional and built on the foundation of his solid work and that of Adrian Thurston, Dean Allen, and many others. We could've put out testing gems forever, but at some point you have to release and see how it does in the wild. One bug has already been reported that I think warrants a 4.0.1, but I'd like to wait at least a week and deliver several bug fixes at once. Thanks for your patience during the rewrite and your input along the way! Upwards, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidsouth at gmail.com Tue Jul 22 16:46:41 2008 From: davidsouth at gmail.com (Dave South) Date: Tue, 22 Jul 2008 14:46:41 -0600 Subject: Wonderful 4.0.0 / Problems with em-dashes Message-ID: <94EDECB5-035E-4804-A0FF-984679467209@gmail.com> It's wonderful to see RedCloth 4.0.0. Thank you for the hard work. I still see one bug that appears to have come back. RedCloth.new('A sentence -- with independent clause -- fails.').to_html Does this:

A sentence - with independent clause - fails.

It should do this:

A sentence — with independent clause — fails.

According to ticket 26 -- on the old Trac -- this was fixed in the SuperRedCloth branch. I've used that branch a while ago and it was working correctly. But it is broken again with RedCloth 4.0.0. I've tried to fix it, but have had no luck. Thanks again. Dave From geraldbauer2007 at gmail.com Wed Jul 23 02:55:21 2008 From: geraldbauer2007 at gmail.com (Gerald Bauer) Date: Tue, 22 Jul 2008 23:55:21 -0700 Subject: [ANN] Release of RedCloth 4.0.0 In-Reply-To: <608C8121-F051-41F5-97E1-4B0CCFD3A4DF@jasongarber.com> References: <608C8121-F051-41F5-97E1-4B0CCFD3A4DF@jasongarber.com> Message-ID: <7e7cb8940807222355j6c9a3268lf68da891b24c17f0@mail.gmail.com> Hello, Congratulations to the RedCloth 4.0.0 release and thanks for the outstanding work and all your efforts. I've upgraded the slideshow (S9) gem that lets you author slides/presentations in Textile to use RedCloth 4.0.0 to test out the new machinery. (You can find some samples @ http://slideshow.rubyforge.org/svn/samples ) All works great except for one slide in the Merb deck. The slide title reads: h1. -vendor/plugins- gems Before 4.0.0 that would translate to:

vendor/plugins gem

But now no longer honors the deletetion modifier and just ends up as:

-vendor/plugins- gem

Anyways, thanks again for the outstanding work and all your efforts to make the RedCloth 4.0.0 release happen. Cheers. -- Gerald Bauer - Internet Professional - http://geraldbauer.wordpress.com From jg at jasongarber.com Wed Jul 23 08:28:56 2008 From: jg at jasongarber.com (Jason Garber) Date: Wed, 23 Jul 2008 08:28:56 -0400 Subject: Wonderful 4.0.0 / Problems with em-dashes In-Reply-To: <94EDECB5-035E-4804-A0FF-984679467209@gmail.com> References: <94EDECB5-035E-4804-A0FF-984679467209@gmail.com> Message-ID: Sorry about the regression. I'm not sure what happened. I've filed a ticket for you: http://jgarber.lighthouseapp.com/ projects/13054-redcloth/tickets/19-two-em-dashes-become-del#ticket-19-3 Thanks for reporting it! On Jul 22, 2008, at 4:46 PM, Dave South wrote: > It's wonderful to see RedCloth 4.0.0. Thank you for the hard work. > > I still see one bug that appears to have come back. > > RedCloth.new('A sentence -- with independent clause -- > fails.').to_html > > Does this: > >

A sentence - with independent clause - fails.

> > It should do this: > >

A sentence — with independent clause — fails.

> > According to ticket 26 -- on the old Trac -- this was fixed in the > SuperRedCloth branch. I've used that branch a while ago and it was > working correctly. > > But it is broken again with RedCloth 4.0.0. > > I've tried to fix it, but have had no luck. > > Thanks again. > > Dave > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From jg at jasongarber.com Wed Jul 23 08:34:51 2008 From: jg at jasongarber.com (Jason Garber) Date: Wed, 23 Jul 2008 08:34:51 -0400 Subject: [ANN] Release of RedCloth 4.0.0 In-Reply-To: <7e7cb8940807222355j6c9a3268lf68da891b24c17f0@mail.gmail.com> References: <608C8121-F051-41F5-97E1-4B0CCFD3A4DF@jasongarber.com> <7e7cb8940807222355j6c9a3268lf68da891b24c17f0@mail.gmail.com> Message-ID: <656AA7D4-B9D3-4F6D-A075-9D2ABDA1956E@jasongarber.com> Gerald, I've filed your bug report as a ticket here: http://jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/20- strikethrough-in-h1-not-working Thanks for reporting it! On Jul 23, 2008, at 2:55 AM, Gerald Bauer wrote: > Hello, > > Congratulations to the RedCloth 4.0.0 release and thanks for the > outstanding work and all your efforts. > > I've upgraded the slideshow (S9) gem that lets you author > slides/presentations in Textile to use RedCloth 4.0.0 to test out the > new machinery. (You can find some samples @ > http://slideshow.rubyforge.org/svn/samples ) > > All works great except for one slide in the Merb deck. The slide > title reads: > > h1. -vendor/plugins- gems > > Before 4.0.0 that would translate to: > >

vendor/plugins gem

> > But now no longer honors the deletetion modifier and just ends up as: > >

-vendor/plugins- gem

> > Anyways, thanks again for the outstanding work and all your efforts > to make the RedCloth 4.0.0 release happen. > > Cheers. > > -- > Gerald Bauer - Internet Professional - http:// > geraldbauer.wordpress.com > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From geraldbauer2007 at gmail.com Wed Jul 23 14:31:24 2008 From: geraldbauer2007 at gmail.com (Gerald Bauer) Date: Wed, 23 Jul 2008 11:31:24 -0700 Subject: [ANN] Release of RedCloth 4.0.0 In-Reply-To: <656AA7D4-B9D3-4F6D-A075-9D2ABDA1956E@jasongarber.com> References: <608C8121-F051-41F5-97E1-4B0CCFD3A4DF@jasongarber.com> <7e7cb8940807222355j6c9a3268lf68da891b24c17f0@mail.gmail.com> <656AA7D4-B9D3-4F6D-A075-9D2ABDA1956E@jasongarber.com> Message-ID: <7e7cb8940807231131t33776be0obfa70bb62457b626@mail.gmail.com> Hello, > Gerald, I've filed your bug report as a ticket here: > http://jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/20-strikethrough-in-h1-not-working Thanks for adding the ticket and looking into it. Just a little addition. I did some more testing and found the strikethrough won't get honored only if it starts out e.g.: h1. -vendor/plugins- gems -vendor/plugins- gems Won't work. But: h1. yada yada -vendor/plugins- gems yada yada -vendor/plugins- gems Will work. In the ticket you write: "You can use square brackets to force a strikethrough." I'd appreciate if you can give an example as I am unclear how to force a strikethrough (e.g. do you mean using just html e.g. h1. vendor/plugins). Again thanks for your efforts in getting RedCloth 4.0.0 out the door. Cheers. -- Gerald Bauer - Internet Professional - http://geraldbauer.wordpress.com From jg at jasongarber.com Wed Jul 23 14:50:01 2008 From: jg at jasongarber.com (Jason Garber) Date: Wed, 23 Jul 2008 14:50:01 -0400 Subject: [ANN] Release of RedCloth 4.0.0 In-Reply-To: <7e7cb8940807231131t33776be0obfa70bb62457b626@mail.gmail.com> References: <608C8121-F051-41F5-97E1-4B0CCFD3A4DF@jasongarber.com> <7e7cb8940807222355j6c9a3268lf68da891b24c17f0@mail.gmail.com> <656AA7D4-B9D3-4F6D-A075-9D2ABDA1956E@jasongarber.com> <7e7cb8940807231131t33776be0obfa70bb62457b626@mail.gmail.com> Message-ID: <5E60A694-8840-4B34-A9AD-9049F289722A@jasongarber.com> Hey, Gerald. I should have provided an example. Sorry about that. Let me give a little explanation for everyone's benefit: All the inline modifiers can be made a little more explicit by surrounding them with square brackets. So, if you want to make a link to a "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language) , you can't get the last character of the link because how would RedCloth know if the link ended with a parenthesis or you just surrounded a link in parentheses (like "this":http://redcloth.org/)? Square brackets to the rescue: ["Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language) ] works perfectly. Same with your strikethrough: surrounding the strikethrough with square brackets makes it work: $ redcloth h1. [-vendor/plugins-] gems outputs:

vendor/plugins gems

Yes, it's annoying and it doesn't conform to Textile 2, but it saves a lot of frustration over things being accidentally struck through, which happened a lot with the old version. Try this with RedCloth 3.x: If I use dashes--like this--to make my statement, it used to get struck through. and you'll get

If I use dashes-like this-to make my statement, it used to get struck through.

As I said in the ticket, if someone can come up with a patch that doesn't sabotage normal text-with-hyphens, I'd be glad to accept it! Thanks, Jason On Jul 23, 2008, at 2:31 PM, Gerald Bauer wrote: > Hello, > >> Gerald, I've filed your bug report as a ticket here: >> http://jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/20-strikethrough-in-h1-not-working > > Thanks for adding the ticket and looking into it. Just a little > addition. I did some more testing and found the strikethrough won't > get honored only if it starts out e.g.: > > h1. -vendor/plugins- gems > > -vendor/plugins- gems > > Won't work. But: > > h1. yada yada -vendor/plugins- gems > > yada yada -vendor/plugins- gems > > Will work. > > In the ticket you write: "You can use square brackets to force a > strikethrough." > > I'd appreciate if you can give an example as I am unclear how to > force a strikethrough (e.g. do you mean using just html e.g. h1. > vendor/plugins). > > Again thanks for your efforts in getting RedCloth 4.0.0 out the > door. Cheers. > > -- > Gerald Bauer - Internet Professional - http:// > geraldbauer.wordpress.com > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards From ryan at fangamer.com Wed Jul 23 19:22:05 2008 From: ryan at fangamer.com (Ryan Alyea) Date: Wed, 23 Jul 2008 18:22:05 -0500 Subject: Disable certain rules? Message-ID: Congrats on shipping RedCloth 4.0! It looks like to fix a few problems that I've had with it. I do have a quick question: how do I disable certain rules? For example, Superusers/Administrators are allowed to use images, but regular users are not. There does not appear to be much documentation about disabling/custom rules. Ryan Alyea Fangamer Founder, Lead Developer ryan at fangamer.com From jg at jasongarber.com Thu Jul 24 05:21:18 2008 From: jg at jasongarber.com (Jason Garber) Date: Thu, 24 Jul 2008 05:21:18 -0400 Subject: Disable certain rules? In-Reply-To: References: Message-ID: <60EB928A-4A11-43EF-8E10-4B569DA8715B@jasongarber.com> That's correct; disabling specific rules is not something I anticipated. Were you able to disable certain rules with 3.0.4? The restrictions :filter_html and :sanitize_html persist in this new version. Are you aware of those? Do they meet your needs? I can think of a couple of image-specific workarounds: One is to prefilter your text before it ever hits RedCloth. Just one regex looking for images shouldn't be too expensive. The other is to modify the output of just images by redefining that method in a new module that you use to extend the RedCloth object when the user isn't a superuser. Best, Jason On Jul 23, 2008, at 7:22 PM, Ryan Alyea wrote: > Congrats on shipping RedCloth 4.0! It looks like to fix a few > problems that I've had with it. > > I do have a quick question: how do I disable certain rules? For > example, Superusers/Administrators are allowed to use images, but > regular users are not. There does not appear to be much > documentation about disabling/custom rules. > > Ryan Alyea > Fangamer Founder, Lead Developer > ryan at fangamer.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: From why at hobix.com Thu Jul 24 18:11:05 2008 From: why at hobix.com (_why) Date: Thu, 24 Jul 2008 17:11:05 -0500 Subject: Ready to release? In-Reply-To: <65418AAA-D061-4CB4-8967-7053F659AB43@jasongarber.com> References: <66d26c8e2b179f66115b2daa765a29b0@ruby-forum.com> <20080721143954.GE49772@beekeeper.hobix.com> <65418AAA-D061-4CB4-8967-7053F659AB43@jasongarber.com> Message-ID: <20080724220742.GM49772@beekeeper.hobix.com> On Tue, Jul 22, 2008 at 05:06:13AM -0400, Jason Garber wrote: > Whoops, sorry why. I just now checked my email and read your message, but > I pushed 4.0 to RubyForge 12 hours ago. You're doing a very fine job of this, Jason. It's great to see RedCloth 4.0 on its way; it's working here in ways I have always wanted. Seriously, thankyou. I need to close down the trac site so we can keep everyone fixed on git and lighthouse from now on. _why From lists at ruby-forum.com Thu Jul 24 18:39:32 2008 From: lists at ruby-forum.com (Tekin Suleyman) Date: Fri, 25 Jul 2008 00:39:32 +0200 Subject: Ready to release? In-Reply-To: <20080724220742.GM49772@beekeeper.hobix.com> References: <66d26c8e2b179f66115b2daa765a29b0@ruby-forum.com> <20080721143954.GE49772@beekeeper.hobix.com> <65418AAA-D061-4CB4-8967-7053F659AB43@jasongarber.com> <20080724220742.GM49772@beekeeper.hobix.com> Message-ID: > You're doing a very fine job of this, Jason. It's great to see > RedCloth 4.0 on its way; it's working here in ways I have always > wanted. Seriously, thankyou. I need to close down the trac site so > we can keep everyone fixed on git and lighthouse from now on. > > _why Indeed, big up your chest! -- Posted via http://www.ruby-forum.com/. From ryan at fangamer.com Thu Jul 24 21:58:20 2008 From: ryan at fangamer.com (Ryan Alyea) Date: Thu, 24 Jul 2008 20:58:20 -0500 Subject: Disable certain rules? In-Reply-To: <60EB928A-4A11-43EF-8E10-4B569DA8715B@jasongarber.com> References: <60EB928A-4A11-43EF-8E10-4B569DA8715B@jasongarber.com> Message-ID: <069471A9-B3B8-4DD5-8C3A-E22843557F6F@fangamer.com> Yeah, it was really easy to disable whole rules with RedCloth(string).to_html(array_of_rules_to_run). For example my array_of_rules has images added for Administrators. In addition, some of my users didn't like how loose the strikethrough was. It was really easy to disable by putting RedCloth::QTAGS.reject!{|x| x[0] == "-"} in my Rails initializers. The HTML filtering is post rendering, and while it might work, I would rather the filter chain not render what I do not want instead of post- filtering. I thought of extending the RedCloth::Formatters::HTML, or creating my own. The problem is that it's not very future-forward. I would have to update my custom Formatters to fit the latest version. If there are no explicit disablers, do you mind if I fork and play around? Ideally I would love for my end to be: body = RedCloth(body_original).to_html(:disable_images unless @user.superuser?) where disable_images is a rule from a custom module I included. Ryan Alyea Fangamer Founder, Lead Developer ryan at fangamer.com On Jul 24, 2008, at 4:21 AM, Jason Garber wrote: > That's correct; disabling specific rules is not something I > anticipated. Were you able to disable certain rules with 3.0.4? > The restrictions :filter_html and :sanitize_html persist in this new > version. Are you aware of those? Do they meet your needs? > > I can think of a couple of image-specific workarounds: One is to > prefilter your text before it ever hits RedCloth. Just one regex > looking for images shouldn't be too expensive. The other is to > modify the output of just images by redefining that method in a new > module that you use to extend the RedCloth object when the user > isn't a superuser. > > Best, > Jason > > On Jul 23, 2008, at 7:22 PM, Ryan Alyea wrote: > >> Congrats on shipping RedCloth 4.0! It looks like to fix a few >> problems that I've had with it. >> >> I do have a quick question: how do I disable certain rules? For >> example, Superusers/Administrators are allowed to use images, but >> regular users are not. There does not appear to be much >> documentation about disabling/custom rules. >> >> Ryan Alyea >> Fangamer Founder, Lead Developer >> ryan at fangamer.com >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jg at jasongarber.com Thu Jul 24 22:29:39 2008 From: jg at jasongarber.com (Jason Garber) Date: Thu, 24 Jul 2008 22:29:39 -0400 Subject: Disable certain rules? In-Reply-To: <069471A9-B3B8-4DD5-8C3A-E22843557F6F@fangamer.com> References: <60EB928A-4A11-43EF-8E10-4B569DA8715B@jasongarber.com> <069471A9-B3B8-4DD5-8C3A-E22843557F6F@fangamer.com> Message-ID: Fork away. That's what GitHub is for! On Jul 24, 2008, at 9:58 PM, Ryan Alyea wrote: > Yeah, it was really easy to disable whole rules with RedCloth > (string).to_html(array_of_rules_to_run). For example my > array_of_rules has images added for Administrators. > > In addition, some of my users didn't like how loose the > strikethrough was. It was really easy to disable by putting > > RedCloth::QTAGS.reject!{|x| x[0] == "-"} > > in my Rails initializers. > > The HTML filtering is post rendering, and while it might work, I > would rather the filter chain not render what I do not want instead > of post-filtering. > > I thought of extending the RedCloth::Formatters::HTML, or creating > my own. The problem is that it's not very future-forward. I would > have to update my custom Formatters to fit the latest version. > > If there are no explicit disablers, do you mind if I fork and play > around? Ideally I would love for my end to be: > > body = RedCloth(body_original).to_html(:disable_images unless > @user.superuser?) > > where disable_images is a rule from a custom module I included. > > Ryan Alyea > Fangamer Founder, Lead Developer > ryan at fangamer.com > > On Jul 24, 2008, at 4:21 AM, Jason Garber wrote: > >> That's correct; disabling specific rules is not something I >> anticipated. Were you able to disable certain rules with 3.0.4? >> The restrictions :filter_html and :sanitize_html persist in this >> new version. Are you aware of those? Do they meet your needs? >> >> I can think of a couple of image-specific workarounds: One is to >> prefilter your text before it ever hits RedCloth. Just one regex >> looking for images shouldn't be too expensive. The other is to >> modify the output of just images by redefining that method in a >> new module that you use to extend the RedCloth object when the >> user isn't a superuser. >> >> Best, >> Jason >> >> On Jul 23, 2008, at 7:22 PM, Ryan Alyea wrote: >> >>> Congrats on shipping RedCloth 4.0! It looks like to fix a few >>> problems that I've had with it. >>> >>> I do have a quick question: how do I disable certain rules? For >>> example, Superusers/Administrators are allowed to use images, but >>> regular users are not. There does not appear to be much >>> documentation about disabling/custom rules. >>> >>> Ryan Alyea >>> Fangamer Founder, Lead Developer >>> ryan at fangamer.com >>> >>> _______________________________________________ >>> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan at fangamer.com Sun Jul 27 03:07:50 2008 From: ryan at fangamer.com (Ryan Alyea) Date: Sun, 27 Jul 2008 02:07:50 -0500 Subject: Disable certain rules? In-Reply-To: References: <60EB928A-4A11-43EF-8E10-4B569DA8715B@jasongarber.com> <069471A9-B3B8-4DD5-8C3A-E22843557F6F@fangamer.com> Message-ID: <5B28AE99-1B65-4743-846B-C5259D8D7713@fangamer.com> Okay, I forked and created a copy that works for me. You can take a look at it here: http://github.com/ROFISH/redcloth The syntax is a lovely RedCloth.new("*string*", [:disable_inline=>:strong]). In addition to images, DRYing things up allowed me to disable any inline element I wanted. Ryan Alyea Fangamer Founder, Lead Developer ryan at fangamer.com On Jul 24, 2008, at 9:29 PM, Jason Garber wrote: > Fork away. That's what GitHub is for! > > On Jul 24, 2008, at 9:58 PM, Ryan Alyea wrote: > >> Yeah, it was really easy to disable whole rules with >> RedCloth(string).to_html(array_of_rules_to_run). For example my >> array_of_rules has images added for Administrators. >> >> In addition, some of my users didn't like how loose the >> strikethrough was. It was really easy to disable by putting >> >> RedCloth::QTAGS.reject!{|x| x[0] == "-"} >> >> in my Rails initializers. >> >> The HTML filtering is post rendering, and while it might work, I >> would rather the filter chain not render what I do not want instead >> of post-filtering. >> >> I thought of extending the RedCloth::Formatters::HTML, or creating >> my own. The problem is that it's not very future-forward. I would >> have to update my custom Formatters to fit the latest version. >> >> If there are no explicit disablers, do you mind if I fork and play >> around? Ideally I would love for my end to be: >> >> body = RedCloth(body_original).to_html(:disable_images unless >> @user.superuser?) >> >> where disable_images is a rule from a custom module I included. >> >> Ryan Alyea >> Fangamer Founder, Lead Developer >> ryan at fangamer.com >> >> On Jul 24, 2008, at 4:21 AM, Jason Garber wrote: >> >>> That's correct; disabling specific rules is not something I >>> anticipated. Were you able to disable certain rules with 3.0.4? >>> The restrictions :filter_html and :sanitize_html persist in this >>> new version. Are you aware of those? Do they meet your needs? >>> >>> I can think of a couple of image-specific workarounds: One is to >>> prefilter your text before it ever hits RedCloth. Just one regex >>> looking for images shouldn't be too expensive. The other is to >>> modify the output of just images by redefining that method in a >>> new module that you use to extend the RedCloth object when the >>> user isn't a superuser. >>> >>> Best, >>> Jason >>> >>> On Jul 23, 2008, at 7:22 PM, Ryan Alyea wrote: >>> >>>> Congrats on shipping RedCloth 4.0! It looks like to fix a few >>>> problems that I've had with it. >>>> >>>> I do have a quick question: how do I disable certain rules? For >>>> example, Superusers/Administrators are allowed to use images, but >>>> regular users are not. There does not appear to be much >>>> documentation about disabling/custom rules. >>>> >>>> Ryan Alyea >>>> Fangamer Founder, Lead Developer >>>> ryan at fangamer.com >>>> >>>> _______________________________________________ >>>> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: