when extracting the code blocks, use the SHA of the lang code AND contents to uniquely identify the snippet

This commit is contained in:
risk
2011-08-04 13:38:05 -07:00
parent c7729f81ad
commit c7d8026ac5
+1 -1
View File
@@ -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 } :