6207d6fbaf66 — Sean Russell 2.1 13 years ago
Fixes #262: subquotes don't recognize sub-attributions
2 files changed, 12 insertions(+), 2 deletions(-)

M parser.rb
A => test/images
M parser.rb +9 -2
@@ 169,10 169,17 @@ module RML
 			}
 			q = Token.new(:quote, {:attribution => attribution}, [])
 			while content_lines.length > 0
-				q.content += content_lines.take_while{|k| k.kind_of? Token or k !~ /^>/}
+				content = content_lines.take_while{|k| k.kind_of? Token or k !~ /^>/}
 				rest = content_lines.drop_while{|k| k.kind_of? Token or k !~ /^>/}
+				if content[-1] =~ /said:\s*$/i
+					new_attr = content[-1]
+					content[-1,1] = []
+				else
+					new_attr = ""
+				end
+				q.content += content
 				subquote = rest.take_while{|k| k.kind_of? String and k =~ /^>/}
-				q.content << process_quote_sub("", subquote) if subquote.size > 0
+				q.content << process_quote_sub(new_attr, subquote) if subquote.size > 0
 				content_lines = rest.drop_while{|k| k.kind_of? String and k =~ /^>/}
 			end
 			return q

          
A => test/images +3 -0
@@ 0,0 1,3 @@ 
+{Chemistry_006.png}
+
+{Chemistry_006.png http://www.google.com}