# frozen_string_literal: true require 'asciidoctor' module Gitlab module Asciidoc class Html5Converter < (Asciidoctor::Converter.for 'html5') register_for 'gitlab_html5' def convert_stem(node) return super unless node.style.to_sym == :latexmath %(#{node.content}) end def convert_inline_quoted(node) return super unless node.type.to_sym == :latexmath %(#{node.text}) end def convert_inline_anchor(node) node.id = "user-content-#{node.id}" if node.id && !node.id.start_with?('user-content-') super(node) end private def id_attribute(node) node.id ? %( id="#{node.id}") : nil end end end end