From 0fccee82b71346e35196533e0052a77a4ed19935 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 16 May 2013 12:15:42 +0300 Subject: [PATCH] Dont parse gfm-extractions as commit. Increase gfm rendering speed. Especially for a lot of code snippets --- lib/gitlab/markdown.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 |!(?\d+) # MR ID |\$(?\d+) # Snippet ID |(?[\h]{6,40}) # Commit ID + |(?gfm-extraction-[\h]{6,40}) # Skip gfm extractions. Otherwise will be parsed as commit ) (?\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