# File lib/maruku/ext/math/mathml_engines/blahtex.rb, line 59
  def convert_to_mathml_blahtex(kind, tex)
    result = run_blahtex(tex, %w[--mathml])

    doc = REXML::Document.new(result)
    mathml = doc.get_elements('//markup').to_a.first
    unless mathml
      maruku_error "Blahtex error: \n#{doc}"
      return nil
    end

    mathml.name = 'math'
    mathml.attributes['xmlns'] = "http://www.w3.org/1998/Math/MathML"
    mathml.attributes['display'] = (kind == :inline) ? :inline : :block

    MaRuKu::HTMLFragment.new(mathml.to_s)
  rescue => e
    maruku_error "Error: #{e}"
    nil
  end