#214 new
Steve Purcell

Links contained in [] within quoted paragraphs aren't recognized

Reported by Steve Purcell | April 11th, 2011 @ 07:40 AM

Regular label links work fine within quoted paras, but wrapping them in [] stops them from getting recognized by textile. This seems to be a recent regression.

Here are 2 failing tests:

diff --git a/spec/fixtures/links.yml b/spec/fixtures/links.yml
index 5e1b957..e9b92ec 100644
--- a/spec/fixtures/links.yml
+++ b/spec/fixtures/links.yml
@@ -263,6 +263,21 @@ html: |-
   <p>&#8220;I first learned about <a href="http://redcloth.org/">Redcloth</a> several years ago.</p>
   <p>&#8220;It&#8217;s wonderful.&#8221;</p>
 ---
+name: with brackets contained in quoted paragraph
+in: |-
+  "I first learned about ["Redcloth":http://redcloth.org/] several years ago."
+html: |-
+  <p>&#8220;I first learned about <a href="http://redcloth.org/">Redcloth</a> several years ago."</p>
+---
+name: with brackets contained in multi-paragraph quotes
+in: |-
+  "I first learned about ["Redcloth":http://redcloth.org/] several years ago.
+
+  "It's wonderful."
+html: |-
+  <p>&#8220;I first learned about <a href="http://redcloth.org/">Redcloth</a> several years ago.</p>
+  <p>&#8220;It&#8217;s wonderful.&#8221;</p>
+---
 name: as html in notextile contained in multi-paragraph quotes
 in: |-
   "Here is a <notextile><a href="http://redcloth.org/">link</a></notextile>.

Comments and changes to this ticket

  • Steve Purcell

    Steve Purcell April 25th, 2011 @ 10:10 AM

    Hey Jason, just thought I'd mention that I had a quick look at the RedCloth source in case I could track down and fix the problem, but I couldn't see what was going wrong. Specifically, I tried adding bracketed_link to the ragel rule for non_quote_chars_or_link, but it didn't help. :-(
    Cheers,
    -Steve

  • Jason Garber

    Jason Garber April 25th, 2011 @ 11:40 AM

    It's crazy, isn't it? I spend hours trying to fix bugs, but it's a
    house of cards. I'm working on a replacement version of RedCloth in
    which I'll actually be able to fix bugs in a timely manner
    (hopefully). https://github.com/jgarber/redcloth-parslet

  • Steve Purcell

    Steve Purcell April 25th, 2011 @ 11:48 AM

    Yeah - I really appreciate all the effort you've put into RedCloth. My understanding is that the textile grammar is somewhat ambiguous, e.g. in comparison to that of markdown, so it's always going to be tricky to cover all the corner cases. I can see how parslet could be a good move. I'm not in a hurry to convert all my textile to markdown just yet. :-)

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