diff options
author | Robert Speicher <robert@gitlab.com> | 2016-06-21 21:23:51 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-06-21 21:23:51 +0300 |
commit | ae63172dd22c245c3d2c0a509971dcb97622e55b (patch) | |
tree | 53379d59e630b50fe941735a2d67886f37d59718 /lib | |
parent | 3f249a0cbaf3f9eea4f5b6dd0ea5d496e5d7a252 (diff) | |
parent | d9a4ca5975b4fb91b147930d863f0bb4b9619a64 (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai.rb | 4 | ||||
-rw-r--r-- | lib/banzai/renderer.rb | 8 |
2 files changed, 2 insertions, 10 deletions
diff --git a/lib/banzai.rb b/lib/banzai.rb index b467413a7dd..093382261ae 100644 --- a/lib/banzai.rb +++ b/lib/banzai.rb @@ -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 diff --git a/lib/banzai/renderer.rb b/lib/banzai/renderer.rb index c14a9c4c722..6718acdef7e 100644 --- a/lib/banzai/renderer.rb +++ b/lib/banzai/renderer.rb @@ -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 |