summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2019-07-03 13:03:08 +0000
committerDouwe Maan <douwe@gitlab.com>2019-07-03 13:03:08 +0000
commitd427c05f586dc89163105f2b89c8f19b07745966 (patch)
tree35b47f47f16f37c5d85d58fa22e537dabbf1a25e /lib/banzai
parent1d7680c6d7c6b312e1aa335034e08b017860edb9 (diff)
parent5854537f117042d6a26b75d00284b9b37b6b8130 (diff)
downloadgitlab-ce-d427c05f586dc89163105f2b89c8f19b07745966.tar.gz
Merge branch 'asciidoc-syntax-highlighting' into 'master'
Enable AsciiDoc syntax highlighting (using Rouge) Closes #32635 See merge request gitlab-org/gitlab-ce!29835
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/syntax_highlight_filter.rb2
-rw-r--r--lib/banzai/pipeline/ascii_doc_pipeline.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/banzai/filter/syntax_highlight_filter.rb b/lib/banzai/filter/syntax_highlight_filter.rb
index fe56f9a1e33..9b66759a5fb 100644
--- a/lib/banzai/filter/syntax_highlight_filter.rb
+++ b/lib/banzai/filter/syntax_highlight_filter.rb
@@ -14,7 +14,7 @@ module Banzai
LANG_PARAMS_ATTR = 'data-lang-params'.freeze
def call
- doc.search('pre > code').each do |node|
+ doc.search('pre:not([data-math-style]) > code').each do |node|
highlight_node(node)
end
diff --git a/lib/banzai/pipeline/ascii_doc_pipeline.rb b/lib/banzai/pipeline/ascii_doc_pipeline.rb
index cc4af280872..6be489c6572 100644
--- a/lib/banzai/pipeline/ascii_doc_pipeline.rb
+++ b/lib/banzai/pipeline/ascii_doc_pipeline.rb
@@ -6,6 +6,7 @@ module Banzai
def self.filters
FilterArray[
Filter::SanitizationFilter,
+ Filter::SyntaxHighlightFilter,
Filter::ExternalLinkFilter,
Filter::PlantumlFilter,
Filter::AsciiDocPostProcessingFilter