From 439f675c5e9cc61c5a41667b9051889accc74949 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sun, 21 Sep 2008 00:59:43 +0200 Subject: Substitute leading whitespace in quotes with en-spaces --- trivium.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trivium.rb b/trivium.rb index 77d7fcf..2680a6e 100644 --- a/trivium.rb +++ b/trivium.rb @@ -69,7 +69,9 @@ class Dots < String else src = %{— #{args.strip}} end - %{
#{BlueCloth.new((body + src).gsub(/^.*$/, '> \& ')).to_html}
} + text = (body + src).gsub(/^ +/) { " " * $&.size }. + gsub(/^.*$/, '> \& ') + %{
#{BlueCloth.new(text).to_html}
} when "math" body << "\\eqno{#{args.strip}}" unless args.strip.empty? %{
#{CGI.escapeHTML body}
} -- cgit 1.4.1