diff options
Diffstat (limited to 'lib/banzai/renderer.rb')
-rw-r--r-- | lib/banzai/renderer.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/banzai/renderer.rb b/lib/banzai/renderer.rb index 3cb9ec21e8f..fbbd6135959 100644 --- a/lib/banzai/renderer.rb +++ b/lib/banzai/renderer.rb @@ -138,15 +138,18 @@ module Banzai # # html - String to process # context - Hash of options to customize output - # :pipeline - Symbol pipeline type + # :pipeline - Symbol pipeline type - for context transform only, defaults to :full # :project - Project # :user - User object + # :post_process_pipeline - pipeline to use for post_processing - defaults to PostProcessPipeline # # Returns an HTML-safe String def self.post_process(html, context) context = Pipeline[context[:pipeline]].transform_context(context) - pipeline = Pipeline[:post_process] + # Use a passed class for the pipeline or default to PostProcessPipeline + pipeline = context.delete(:post_process_pipeline) || ::Banzai::Pipeline::PostProcessPipeline + if context[:xhtml] pipeline.to_document(html, context).to_html(save_with: Nokogiri::XML::Node::SaveOptions::AS_XHTML) else |