Commit 0fccee82b71346e35196533e0052a77a4ed19935
1 parent
9b1b5aee
Exists in
master
and in
4 other branches
Dont parse gfm-extractions as commit. Increase gfm rendering speed. Especially f…
…or a lot of code snippets
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
lib/gitlab/markdown.rb
... | ... | @@ -101,6 +101,7 @@ module Gitlab |
101 | 101 | |!(?<merge_request>\d+) # MR ID |
102 | 102 | |\$(?<snippet>\d+) # Snippet ID |
103 | 103 | |(?<commit>[\h]{6,40}) # Commit ID |
104 | + |(?<skip>gfm-extraction-[\h]{6,40}) # Skip gfm extractions. Otherwise will be parsed as commit | |
104 | 105 | ) |
105 | 106 | (?<suffix>\W)? # Suffix |
106 | 107 | }x.freeze |
... | ... | @@ -113,6 +114,9 @@ module Gitlab |
113 | 114 | prefix = $~[:prefix] |
114 | 115 | suffix = $~[:suffix] |
115 | 116 | type = TYPES.select{|t| !$~[t].nil?}.first |
117 | + | |
118 | + next unless type | |
119 | + | |
116 | 120 | identifier = $~[type] |
117 | 121 | |
118 | 122 | # Avoid HTML entities | ... | ... |