[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RedCloth full textile support?

Rick DeNatale

2/1/2008 9:49:00 PM

I'm trying to use the redcloth gem to do textile markup.

It works, but doesn't seem to support the full set of markup.

For example trying a few examples from:
http://hobix.com/textile/... which is linked to from _why?s
Redcloth page http://whytheluckystiff.net/ruby...

require 'rubygems'
require 'redcloth'

class String
def textilize
RedCloth.new(self).to_html
end
end

"*bold* _italic_".textilize # => "<p><strong>bold</strong> <em>italic</em></p>"
".h1 Heading".textilize # => "<p>.h1 Heading</p>"

So a few things seems to work but many more don't.

Is there something I'm missing?

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...

2 Answers

Rob Biedenharn

2/1/2008 10:35:00 PM

0


On Feb 1, 2008, at 4:49 PM, Rick DeNatale wrote:

> I'm trying to use the redcloth gem to do textile markup.
>
> It works, but doesn't seem to support the full set of markup.
>
> For example trying a few examples from:
> http://hobix.com/textile/... which is linked to from _why?s
> Redcloth page http://whytheluckystiff.net/ruby...
>
> require 'rubygems'
> require 'redcloth'
>
> class String
> def textilize
> RedCloth.new(self).to_html
> end
> end
>
> "*bold* _italic_".textilize # => "<p><strong>bold</strong>
> <em>italic</em></p>"
> ".h1 Heading".textilize # => "<p>.h1 Heading</p>"
>
> So a few things seems to work but many more don't.
>
> Is there something I'm missing?

Perhaps:
irb> "h1. Heading".textilize
=> "<h1>Heading</h1>"

Not ".h1" but "h1." does a heading.

-Rob

> --
> Rick DeNatale
>
> My blog on Ruby
> http://talklikeaduck.denh...
>

Rob Biedenharn http://agileconsult...
Rob@AgileConsultingLLC.com


Rick DeNatale

2/1/2008 11:03:00 PM

0

Yep, I'm dyslexic I guess ;-(

On Feb 1, 2008 5:35 PM, Rob Biedenharn <Rob@agileconsultingllc.com> wrote:
>
> On Feb 1, 2008, at 4:49 PM, Rick DeNatale wrote:
>
> > I'm trying to use the redcloth gem to do textile markup.
> >
> > It works, but doesn't seem to support the full set of markup.
> >
> > For example trying a few examples from:
> > http://hobix.com/textile/... which is linked to from _why?s
> > Redcloth page http://whytheluckystiff.net/ruby...
> >
> > require 'rubygems'
> > require 'redcloth'
> >
> > class String
> > def textilize
> > RedCloth.new(self).to_html
> > end
> > end
> >
> > "*bold* _italic_".textilize # => "<p><strong>bold</strong>
> > <em>italic</em></p>"
> > ".h1 Heading".textilize # => "<p>.h1 Heading</p>"
> >
> > So a few things seems to work but many more don't.
> >
> > Is there something I'm missing?
>
> Perhaps:
> irb> "h1. Heading".textilize
> => "<h1>Heading</h1>"
>
> Not ".h1" but "h1." does a heading.
>
> -Rob
>
>
> > --
> > Rick DeNatale
> >
> > My blog on Ruby
> > http://talklikeaduck.denh...
> >
>
> Rob Biedenharn http://agileconsult...
> Rob@AgileConsultingLLC.com
>
>
>



--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...