diff options
author | Guillaume Grossetie <ggrossetie@gmail.com> | 2019-06-19 08:37:48 +0200 |
---|---|---|
committer | Guillaume Grossetie <ggrossetie@gmail.com> | 2019-07-02 09:24:05 +0200 |
commit | 5854537f117042d6a26b75d00284b9b37b6b8130 (patch) | |
tree | 7af3308e702968dc5d1ab6797380299b22fd05be /lib/banzai | |
parent | 02ad0c2f6aedfe5053a79b027cc2882115c1cad5 (diff) | |
download | gitlab-ce-5854537f117042d6a26b75d00284b9b37b6b8130.tar.gz |
Enable AsciiDoc syntax highlighting (using Rouge)
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/syntax_highlight_filter.rb | 2 | ||||
-rw-r--r-- | lib/banzai/pipeline/ascii_doc_pipeline.rb | 1 |
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 |