From def3f3e827c5d8dbfe875f06dd2e4e46d96ad2b4 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Sun, 15 Mar 2009 11:35:41 -0400 Subject: [PATCH] Fixed attributes getting escaped multiple times because of passing by reference --- ext/redcloth_scan/redcloth_scan.rb.rl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/redcloth_scan/redcloth_scan.rb.rl b/ext/redcloth_scan/redcloth_scan.rb.rl index 5f5db8bb..81023c62 100644 --- a/ext/redcloth_scan/redcloth_scan.rb.rl +++ b/ext/redcloth_scan/redcloth_scan.rb.rl @@ -41,9 +41,10 @@ module RedCloth return RedCloth::RedclothInline.redcloth_inline2(self, textile_doc, refs) end - def html_esc(str, level=nil) - return "" if str.nil? || str.empty? + def html_esc(input, level=nil) + return "" if input.nil? || input.empty? + str = input.dup str.gsub!('&') { amp({}) } str.gsub!('>') { gt({}) } str.gsub!('<') { lt({}) }