Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #607

  • Loading branch information...
commit cb1a633dc5823e412875c3ac5960c39eebb7cb2b 1 parent ace4db6
@bootstraponline bootstraponline authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/gollum/markup.rb
View
4 lib/gollum/markup.rb
@@ -475,7 +475,7 @@ def extract_gitcode data
#
# Returns the placeholder'd String 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_start = $2 # ~~~
m_lang = $3
@@ -504,7 +504,7 @@ def extract_code(data)
"#{m_indent}#{id}" # print the SHA1 ID with the proper indentation
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
id = Digest::SHA1.hexdigest("#{lang}.#{$3}")
cached = check_cache(:code, id)
Please sign in to comment.
Something went wrong with that request. Please try again.