#19 ✓resolved
Jason Garber

Two em dashes become del

Reported by Jason Garber | July 23rd, 2008 @ 08:26 AM | in 4.0.1

From the mailing list:

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

Comments and changes to this ticket

  • Jason Garber

    Jason Garber July 23rd, 2008 @ 08:28 AM

    • State changed from “new” to “open”

    I'm troubled by the regression. What happened? :-(

    Thanks for reporting it, Dave.

    Just out of curiousity, did lighthouse upgrade to RedCloth [RedCloth::VERSION]?

  • Jason Garber

    Jason Garber July 23rd, 2008 @ 08:28 AM

    Nope. It's just that my cut 'n paste worked, for once!

  • Dave South

    Dave South July 23rd, 2008 @ 10:18 AM

    On further review I've found that if you don't put spaces around the dashes, then it works properly.

    RedCloth.new("Text--without spaces--between the dashes.").to_html

    => "

    Text—without spaces—between the dashes.

    "

    However, with spaces it fails.

    RedCloth.new("Text -- without spaces -- between the dashes.").to_html

    => "

    Text - without spaces - between the dashes.

    "

    According to the textile documents, the spaces around a double-hyphen are to be removed.

    For single em-dash replacement, this isn't happening:

    RedCloth.new("Text -- with one hyphen").to_html

    => "

    Text — with one hyphen

    "

    It should return

    => "

    Text—with one hyphen

    "

  • Jason Garber

    Jason Garber July 23rd, 2008 @ 11:07 AM

    • State changed from “open” to “resolved”

    (from [8f767de26e62e605e23b1f0c7725c911adc645c5]) Fixed parsing sentences that had two em dashes surrounded by spaces from becoming del phrases. [#19 state:resolved]

    http://github.com/jgarber/redclo...

  • Jason Garber

    Jason Garber July 23rd, 2008 @ 11:10 AM

    I fixed the problem before reading your last comment.

    Where are you reading that spaces around double-hyphens are to be removed? That would be my preference, but the textile reference manual leaves them in. I'm curious where you're finding that.

  • Dave South

    Dave South July 23rd, 2008 @ 12:00 PM

    Thank you for fixing this so quickly. I couldn't make heads-or-tails

    of the Ragel based code.

    I was under a mistaken impression based on how this website handles em-

    dashes.

    http://www.textism.com/tools/tex...

    It's parser removes the spaces around the em-dashes. From a

    typesetting point of view, this is the correct behavior. But if the

    Textile manual says to keep the spaces, then we probably should.

    It'd be nice if a person could specify this behavior as an option. But

    that sounds like more trouble than it's worth.

    Thanks again for all the hard work.

    Dave

    On Jul 23, 2008, at 9:10 AM, Lighthouse wrote:

  • Jason Garber

    Jason Garber July 24th, 2008 @ 09:55 AM

    • Milestone set to 4.0.1

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

RedCloth is a Ruby library for converting Textile into HTML

Shared Ticket Bins

People watching this ticket

Referenced by

Pages