From c7d8026ac59bef82f7c8dc211ce4b630c9737016 Mon Sep 17 00:00:00 2001 From: risk Date: Thu, 4 Aug 2011 13:38:05 -0700 Subject: [PATCH] when extracting the code blocks, use the SHA of the lang code AND contents to uniquely identify the snippet --- lib/gollum/markup.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index 56a53276..bb63af49 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -366,7 +366,7 @@ module Gollum # Returns the placeholder'd String data. def extract_code(data) data.gsub!(/^``` ?([^\r\n]+)?\r?\n(.+?)\r?\n```\r?$/m) do - id = Digest::SHA1.hexdigest($2) + id = Digest::SHA1.hexdigest("#{$1}.#{$2}") cached = check_cache(:code, id) @codemap[id] = cached ? { :output => cached } :