From 9a4c37784c675d1f36e02a4c4ac5715f165a70d3 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Fri, 29 May 2009 22:34:01 -0400 Subject: [PATCH] Include an ending question mark in a citation. [#109 state:resolved] --- CHANGELOG | 2 ++ ext/redcloth_scan/redcloth_inline.rl | 2 +- spec/fixtures/basic.yml | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index ab11cf50..5e20f89c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ === Edge +* Include an ending question mark in a citation. [Jason Garber] + * Preserve leading whitespace in pre and bc blocks. [Jason Garber] * Don't add hard break after preexisting
. [Jason Garber] diff --git a/ext/redcloth_scan/redcloth_inline.rl b/ext/redcloth_scan/redcloth_inline.rl index 29629d3d..be58d3da 100644 --- a/ext/redcloth_scan/redcloth_inline.rl +++ b/ext/redcloth_scan/redcloth_inline.rl @@ -60,7 +60,7 @@ sub_phrase = ( "~" when starts_phrase) >X ( mtext ) >A %T :>> ( "~" end_markup_phrase ) ; span = "[%" >X mtext >A %T :> "%]" ; span_phrase = (("%" when starts_phrase) >X ( mtext ) >A %T :>> ( "%" end_markup_phrase )) ; - cite = "["? "??" >X mtext >A %T :> "??" "]"? ; + cite = "["? "??" >X mtext >A >ATTR :>> ("?" @T ( "?" | "?" @{ STORE_ATTR("text"); } "?" %SET_ATTR )) "]"? ; ignore = "["? "==" >X %A mtext %T :> "==" "]"? ; snip = "["? "```" >X %A mtext %T :> "```" "]"? ; diff --git a/spec/fixtures/basic.yml b/spec/fixtures/basic.yml index f29090e2..504618a6 100644 --- a/spec/fixtures/basic.yml +++ b/spec/fixtures/basic.yml @@ -978,3 +978,13 @@ in: |- html: |-
  false
   } else {
+--- +name: citation ending with question mark +in: "??What the Story Morning Glory???" +html: |- +

What the Story Morning Glory?

+--- +name: citation including question mark +in: "??What's the Matter with Kansas? How Conservatives Won the Heart of America?? is a great book!" +html: |- +

What’s the Matter with Kansas? How Conservatives Won the Heart of America is a great book!