Ticket #26 (new defect)

Opened 10 months ago

Last modified 9 months ago

RedCloth (3.0.4 and repository) em-dash vs. strikethru bug

Reported by: purp Owned by: why
Priority: major Milestone:
Component: ext Version: 3.0.4
Keywords: Cc:

Description

This:

RedCloth.new('more -- chunky -- bacon').to_html

... should return this (according to http://textism.com/tools/textile/index.php):

<p>more&#8212;chunky&#8212;bacon</p>

Instead, it returns this:

<p>foo <del>- bar -</del> baz</p>

This appears to be due to two things:

1. An order inversion of the inline_textile_span and glyphs_textile methods in the textile_rules array of RedCloth#to_html

2. A bug in RedCloth#inline which causes all inline_* methods to be run before any glyphs_* methods due to the order of the regexes listed in the method's first line.

I'd propose fixing this with the attached patch, made against the r193 of the trunk in svn.

Thanks for the excellent lib!

--j

Attachments

glyphs_inline_ordering_bug.patch (1.6 kB) - added by purp 10 months ago.
Patch (with tests) fixing inline/glyphs ordering bug

Change History

Changed 10 months ago by purp

Patch (with tests) fixing inline/glyphs ordering bug

Changed 9 months ago by jgarber

  • version set to 3.0.4

Works correctly in the SuperRedCloth branch.

Note: See TracTickets for help on using tickets.