From 138e26b1fad6730aa048b8cc91f92a597e323162 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 4 Oct 2016 14:06:44 +0100 Subject: Adds v-pre to code blocks in comments Closes #22911 --- lib/banzai/filter/sanitization_filter.rb | 2 +- lib/banzai/filter/syntax_highlight_filter.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/banzai') diff --git a/lib/banzai/filter/sanitization_filter.rb b/lib/banzai/filter/sanitization_filter.rb index 2470362e019..af1e575fc89 100644 --- a/lib/banzai/filter/sanitization_filter.rb +++ b/lib/banzai/filter/sanitization_filter.rb @@ -25,7 +25,7 @@ module Banzai return if customized?(whitelist[:transformers]) # Allow code highlighting - whitelist[:attributes]['pre'] = %w(class) + whitelist[:attributes]['pre'] = %w(class v-pre) whitelist[:attributes]['span'] = %w(class) # Allow table alignment diff --git a/lib/banzai/filter/syntax_highlight_filter.rb b/lib/banzai/filter/syntax_highlight_filter.rb index fcdb496aed2..bb6b4582e4f 100644 --- a/lib/banzai/filter/syntax_highlight_filter.rb +++ b/lib/banzai/filter/syntax_highlight_filter.rb @@ -30,7 +30,8 @@ module Banzai # users can still access an issue/comment/etc. end - highlighted = %(
#{code}
) + highlighted = %(
#{code}
) + puts highlighted # Extracted to a method to measure it replace_parent_pre_element(node, highlighted) -- cgit v1.2.1