#226 new
Carol Nichols

Emphasis underscores too greedy when followed by a link containing underscores

Reported by Carol Nichols | July 23rd, 2011 @ 03:17 PM

I'm using RedCloth 4.2.7. This is a bit of Textile I found in the edge Rails guides:

  Please use American English (_color_, _center_, _modularize_, etc.). See "a list of American and British English spelling differences here":http://en.wikipedia.org/wiki/American_and_British_English_spelling_differences.

What I get with RedCloth 4.2.7 and on http://redcloth.org/ is:

  <p>Please use American English (<em>color</em>, <em>center</em>, <em>modularize_, etc.). See <a href="http://en.wikipedia.org/wiki/American_and_British_English_spelling">a list of American and British English spelling differences here</a></em>differences.</p>

What I expect to get, and what I get on http://textile.thresholdstate.com/ is:

    <p>Please use American English (<em>color</em>, <em>center</em>, <em>modularize</em>, etc.). See <a href="http://en.wikipedia.org/wiki/American_and_British_English_spelling_differences">a list of American and British English spelling differences here</a>.</p>

It looks to my untrained eye that the underscore for the em around modularize is being too greedy and is going until the underscore between spelling and differences in the link, and then the link gets created after that?

The workaround I'm going to add to the Rails guide is using em tags instead of underscores; this generates the HTML I expect.

If there's any other information that would be helpful, please let me know. Thanks!

Comments and changes to this ticket

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

Pages