debian-mirror-gitlab/lib/gitlab/asciidoc/syntax_highlighter/html_pipeline_adapter.rb

20 lines
566 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# 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)
2022-01-26 12:08:38 +05:30
if Feature.enabled?(:use_cmark_renderer, default_enabled: :yaml)
2021-12-11 22:18:48 +05:30
%(<pre #{lang ? %[lang="#{lang}"] : ''}><code>#{node.content}</code></pre>)
else
%(<pre><code #{lang ? %[ lang="#{lang}"] : ''}>#{node.content}</code></pre>)
end
2019-09-30 21:07:59 +05:30
end
end
end
end
end