Commit ae63172d authored by Robert Speicher's avatar Robert Speicher

Merge branch 'remove-banzai-pre-process' into 'master'

Move pre_process into render_result

This MR moves `Banzai::Renderer.pre_process` into `Banzai::Renderer.render_result`.

The `pre_process` method was called even when its output would be ignored. See 11a5a4f359ee57029dbfcc9185fc6b47243ea2aa for more details.

See merge request !4830
parents 3f249a0c d9a4ca59
......@@ -16,6 +16,7 @@ v 8.9.0 (unreleased)
- Fix issue with arrow keys not working in search autocomplete dropdown
- Fix an issue where note polling stopped working if a window was in the
background during a refresh.
- Pre-processing Markdown now only happens when needed
- Make EmailsOnPushWorker use Sidekiq mailers queue
- Redesign all Devise emails. !4297
- Don't show 'Leave Project' to group members
......
......@@ -50,8 +50,6 @@ module GitlabMarkdownHelper
context[:project] ||= @project
text = Banzai.pre_process(text, context)
html = Banzai.render(text, context)
context.merge!(
......
......@@ -7,10 +7,6 @@ module Banzai
Renderer.render_result(text, context)
end
def self.pre_process(text, context)
Renderer.pre_process(text, context)
end
def self.post_process(html, context)
Renderer.post_process(html, context)
end
......
......@@ -30,13 +30,9 @@ module Banzai
end
def self.render_result(text, context = {})
Pipeline[context[:pipeline]].call(text, context)
end
text = Pipeline[:pre_process].to_html(text, context) if text
def self.pre_process(text, context)
pipeline = Pipeline[:pre_process]
pipeline.to_html(text, context)
Pipeline[context[:pipeline]].call(text, context)
end
# Perform post-processing on an HTML String
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment