Dont parse gfm-extractions as commit. Increase gfm rendering speed. Especially for a lot of code snippets

This commit is contained in:
Dmitriy Zaporozhets 2013-05-16 12:15:42 +03:00
parent 9b1b5aee83
commit 0fccee82b7

View file

@ -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