Strikethroughs and dashes
hgs at dmu.ac.uk
Thu Jan 25 05:22:32 EST 2007
On Wed, 24 Jan 2007, why the lucky stiff wrote:
> On Wed, Jan 24, 2007 at 10:07:06AM +0000, Hugh Sasse wrote:
> > > Okay, in SuperRedCloth:
> > >
> > > space dash words+ dash space
> > /\s+\-\b(.*)\b\-\s/
> Not quite. The definition of "words" isn't (.*). It's a bit more
:-) This was just to get the ends about right as a first shot.
> > irb(main):002:0> str= " I died in -2048 -- yes -- ate my own dogfood- no, just now"
> > => " I died in -2048 -- yes -- ate my own dogfood- no, just now"
> > irb(main):003:0> str =~ regexp
> > => 10
> > irb(main):004:0> puts $1
> > 2048 -- yes -- ate my own dogfood
> That's correct. Dashes are found up against the "2048" and
> "dogfood", so that would be a strike.
> But you bring up yet another great ambiguity: negative numbers!!
New dimensions in temporal physics... :-) Good point though, I
hadn't thought of that. How to strikeout a negative number?
-\-2048 -- That was way back in negative time!-
> > irb(main):006:0> str = " what - will - this - do?"
> > => " what - will - this - do?"
> > irb(main):007:0> str =~ regexp
> > => nil
> That's also correct. Those dashes are en dashes. There's no
> question there.
> > I don't know enough about Super Red Cloth to add anything useful,
> > except that if it makes it easier to maintain, that is good. I'm
> > not clear about how Ragel fits into the picture yet, whether we
> > need to install that as well to get it to work or what.
> You won't need to install Ragel unless you're compiling from the
> repo. The tarball and gem dists will be premade for ya. See
> Hpricot and Mongrel -- same thing.
Thanks. (OT: Is it pronounced more like Rigel or Bagel, soft or hard
More information about the Redcloth-upwards