From e95275da8738bebab04604ba48b992d0f8222019 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 13 Feb 2014 20:31:36 -0300 Subject: [PATCH] Revert "application_helper: use Nokogiri in convert_macro() instead of Hpricot" --- app/helpers/application_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0f1d2af..3bf2178 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1382,16 +1382,16 @@ module ApplicationHelper end def convert_macro(html, source) - doc = Nokogiri::HTML(html) + doc = Hpricot(html) #TODO This way is more efficient but do not support macro inside of # macro. You must parse them from the inside-out in order to enable # that. - doc.css('.macro').each do |macro| + doc.search('.macro').each do |macro| macro_name = macro['data-macro'] result = @plugins.parse_macro(macro_name, macro, source) - macro.content = result.kind_of?(Proc) ? self.instance_eval(&result) : result + macro.inner_html = result.kind_of?(Proc) ? self.instance_eval(&result) : result end - CGI.unescapeHTML(doc.xpath('//body/*').to_s) + doc.html end def default_folder_for_image_upload(profile) -- libgit2 0.21.2