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.

This commit is contained in:
Sarah Mei 2011-09-03 11:26:11 -07:00
parent 2afb646286
commit 9960b5b189

View file

@ -116,13 +116,13 @@ module Diaspora
end end
def preprocess(full_document) def preprocess(full_document)
entities = { entities = [
'>' => '>', ['&', '&'],
'<' => '&lt;', ['>', '&gt;'],
'&' => '&amp;', ['<', '&lt;']
} ]
entities.each do |k,v| entities.each do |original, replacement|
full_document = full_document.gsub(k, v) full_document = full_document.gsub(original, replacement)
end end
if @specialchars if @specialchars