diff options
Diffstat (limited to 'lib/gitlab/asciidoc/syntax_highlighter/html_pipeline_adapter.rb')
-rw-r--r-- | lib/gitlab/asciidoc/syntax_highlighter/html_pipeline_adapter.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/gitlab/asciidoc/syntax_highlighter/html_pipeline_adapter.rb b/lib/gitlab/asciidoc/syntax_highlighter/html_pipeline_adapter.rb new file mode 100644 index 00000000000..5fc3323f0fd --- /dev/null +++ b/lib/gitlab/asciidoc/syntax_highlighter/html_pipeline_adapter.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Gitlab + module Asciidoc + module SyntaxHighlighter + class HtmlPipelineAdapter < Asciidoctor::SyntaxHighlighter::Base + register_for 'gitlab-html-pipeline' + + def format(node, lang, opts) + %(<pre><code #{lang ? %[ lang="#{lang}"] : ''}>#{node.content}</code></pre>) + end + end + end + end +end |