From 023d84c4a421b1210013aefb461a634d45880bd3 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Tue, 8 Dec 2009 09:08:25 -0600 Subject: [PATCH] Ack! This is better --- lib/chunks/wiki.rb | 3 ++- lib/wiki_content.rb | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/chunks/wiki.rb b/lib/chunks/wiki.rb index c14af2a7..e7d5ddaa 100644 --- a/lib/chunks/wiki.rb +++ b/lib/chunks/wiki.rb @@ -1,4 +1,5 @@ require 'chunks/chunk' +require 'stringsupport' # Contains all the methods for finding and replacing wiki related links. module WikiChunk @@ -33,7 +34,7 @@ module WikiChunk end def self.apply_to(content) - content.gsub!( self.pattern ) do |matched_text| + content.as_utf8.gsub!( self.pattern ) do |matched_text| chunk = self.new($~, content) if chunk.textile_url? # do not substitute diff --git a/lib/wiki_content.rb b/lib/wiki_content.rb index 2e3b6be4..e047a96a 100644 --- a/lib/wiki_content.rb +++ b/lib/wiki_content.rb @@ -190,7 +190,7 @@ class WikiContent < String def render! pre_render! @options[:engine].apply_to(self) - as_bytes + as_utf8 # unmask in one go. $~[1] is the chunk id gsub!(MASK_RE[ACTIVE_CHUNKS]) do chunk = @chunks_by_id[$~[1].to_i] @@ -202,7 +202,6 @@ class WikiContent < String chunk.unmask_text end end - as_utf8 self.replace xhtml_sanitize(self) end