Skip to content
This repository has been archived by the owner on Apr 19, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline committed Dec 15, 2012
1 parent ace4db6 commit cb1a633
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/gollum/markup.rb
Expand Up @@ -475,7 +475,7 @@ def extract_gitcode data
# #
# Returns the placeholder'd String data. # Returns the placeholder'd String data.
def extract_code(data) def extract_code(data)
data.gsub!(/^([ \t]*)(~~~+) ?([^\r\n]+)?\r?\n(.+?)\r?\n\1(~~~+)\r?$/m) do data.gsub!(/^([ \t]*)(~~~+) ?([^\r\n]+)?\r?\n(.+?)\r?\n\1(~~~+)[ \t\r]*$/m) do
m_indent = $1 m_indent = $1
m_start = $2 # ~~~ m_start = $2 # ~~~
m_lang = $3 m_lang = $3
Expand Down Expand Up @@ -504,7 +504,7 @@ def extract_code(data)
"#{m_indent}#{id}" # print the SHA1 ID with the proper indentation "#{m_indent}#{id}" # print the SHA1 ID with the proper indentation
end end


data.gsub!(/^([ \t]*)``` ?([^\r\n]+)?\r?\n(.+?)\r?\n\1```\r?$/m) do data.gsub!(/^([ \t]*)``` ?([^\r\n]+)?\r?\n(.+?)\r?\n\1```[ \t\r]*$/m) do
lang = $2 ? $2.strip : nil lang = $2 ? $2.strip : nil
id = Digest::SHA1.hexdigest("#{lang}.#{$3}") id = Digest::SHA1.hexdigest("#{lang}.#{$3}")
cached = check_cache(:code, id) cached = check_cache(:code, id)
Expand Down

0 comments on commit cb1a633

Please sign in to comment.