From 9960b5b1893cb75b00ba727df358aa93eda7466d Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sat, 3 Sep 2011 11:26:11 -0700 Subject: [PATCH] Gotta escape & before other stuff in markdownify - in 1.8 it was always first but not in 1.9 because the list of entities was a hash. This change converts to an array. --- lib/diaspora/markdownify.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/diaspora/markdownify.rb b/lib/diaspora/markdownify.rb index c57d8d495..c21fdaa68 100644 --- a/lib/diaspora/markdownify.rb +++ b/lib/diaspora/markdownify.rb @@ -116,13 +116,13 @@ module Diaspora end def preprocess(full_document) - entities = { - '>' => '>', - '<' => '<', - '&' => '&', - } - entities.each do |k,v| - full_document = full_document.gsub(k, v) + entities = [ + ['&', '&'], + ['>', '>'], + ['<', '<'] + ] + entities.each do |original, replacement| + full_document = full_document.gsub(original, replacement) end if @specialchars