class ReverseAsciidoctor::Converters::Math

Public Instance Methods

convert(node, state = {}) click to toggle source
# File lib/reverse_asciidoctor/converters/math.rb, line 10
def convert(node, state = {})
  stem = node.to_s.gsub(/\n/, " ")
  stem = MathML2AsciiMath.m2a(stem) if ReverseAsciidoctor.config.mathml2asciimath
  stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub(/\(\(([^\)]+)\)\)/, "(\\1)") unless stem.nil?
  " stem:[" << stem << "] "
end