Skip to content
Snippets Groups Projects
Commit a34c61d9 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Reuse HTML Pipeline object in Markdown parser

The patches reduces pressure on GC and reduces markdown processing time
parent 16c71a3b
No related branches found
No related tags found
1 merge request!905Reuse HTML Pipeline object in Markdown parser
Loading
@@ -54,7 +54,7 @@ module Gitlab
Loading
@@ -54,7 +54,7 @@ module Gitlab
current_user: current_user current_user: current_user
) )
   
pipeline = HTML::Pipeline.new(filters) @pipeline ||= HTML::Pipeline.new(filters)
   
context = { context = {
# SanitizationFilter # SanitizationFilter
Loading
@@ -79,7 +79,7 @@ module Gitlab
Loading
@@ -79,7 +79,7 @@ module Gitlab
project_wiki: @project_wiki project_wiki: @project_wiki
} }
   
result = pipeline.call(text, context) result = @pipeline.call(text, context)
   
save_options = 0 save_options = 0
if options[:xhtml] if options[:xhtml]
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment