summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-16 12:15:42 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-16 12:15:42 +0300
commit0fccee82b71346e35196533e0052a77a4ed19935 (patch)
tree26f642483d1edb1bbe643e2603e7aa144a0c0bd3
parent9b1b5aee836cd4a874888317d504252ca7fdcf3d (diff)
downloadgitlab-ce-0fccee82b71346e35196533e0052a77a4ed19935.tar.gz
Dont parse gfm-extractions as commit. Increase gfm rendering speed. Especially for a lot of code snippets
-rw-r--r--lib/gitlab/markdown.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb
index ad6ba3e8fd6..05c118b81a1 100644
--- a/lib/gitlab/markdown.rb
+++ b/lib/gitlab/markdown.rb
@@ -101,6 +101,7 @@ module Gitlab
|!(?<merge_request>\d+) # MR ID
|\$(?<snippet>\d+) # Snippet ID
|(?<commit>[\h]{6,40}) # Commit ID
+ |(?<skip>gfm-extraction-[\h]{6,40}) # Skip gfm extractions. Otherwise will be parsed as commit
)
(?<suffix>\W)? # Suffix
}x.freeze
@@ -113,6 +114,9 @@ module Gitlab
prefix = $~[:prefix]
suffix = $~[:suffix]
type = TYPES.select{|t| !$~[t].nil?}.first
+
+ next unless type
+
identifier = $~[type]
# Avoid HTML entities