Sha256: 4c05e891e1314f2bc1123f9bc8fac2017f3b4dbf6718f72ea49eb3529c3ebf02

Contents?: true

Size: 925 Bytes

Versions: 75

Compression:

Stored size: 925 Bytes

Contents

# -*- coding: utf-8 -*-
#
#--
# Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
#
# This file is part of kramdown which is licensed under the MIT.
#++
#

module Kramdown::Converter::MathEngine

  # Uses the Itex2MML library for converting math formulas to MathML.
  module Itex2MML

    begin
      require 'itextomml'

      # Itex2MML is available if this constant is +true+.
      AVAILABLE = true
    rescue LoadError
      AVAILABLE = false  # :nodoc:
    end

    def self.call(converter, el, opts)
      type = el.options[:category]
      parser = ::Itex2MML::Parser.new
      result = (type == :block ? parser.block_filter(el.value) : parser.inline_filter(el.value))

      attr = el.attr.dup
      attr.delete('xmlns')
      attr.delete('display')
      result.insert("<math".length, converter.html_attributes(attr))

      (type == :block ? "#{' '*opts[:indent]}#{result}\n" : result)
    end

  end

end

Version data entries

75 entries across 72 versions & 18 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/converter/math_engine/itex2mml.rb