# module Kramdown::Converter::MathEngine::Katex

Uses the KaTeX gem for converting math formulas to KaTeX HTML.

### Constants

AVAILABLE

### Public Class Methods

call(converter, el, opts) click to toggle source

    # File lib/kramdown/converter/math_engine/katex.rb, line 18
    def self.call(converter, el, opts)
      display_mode = el.options[:category] == :block
      result = ::Katex.render(
          el.value,
          display_mode: display_mode,
          throw_on_error: false,
          **converter.options[:math_engine_opts]
      )
      attr = el.attr.dup
      attr.delete('xmlns')
      attr.delete('display')
      result.insert(result =~ /[[:space:]>]/, converter.html_attributes(attr))
      result = "#{' ' * opts[:indent]}#{result}\n" if display_mode
      result
    end