Sha256: d69681a1d6bdfa99b1e47dd274742b2ad3fe36091633157b49fc763765422eb9

Contents?: true

Size: 858 Bytes

Versions: 75

Compression:

Stored size: 858 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 Ritex library for converting math formulas to MathML.
  module Ritex

    begin
      require 'ritex'

      # Ritex 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]
      result = ::Ritex::Parser.new.parse(el.value, :display => (type == :block))

      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
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/kramdown-1.13.1/lib/kramdown/converter/math_engine/ritex.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/kramdown-1.13.1/lib/kramdown/converter/math_engine/ritex.rb
kramdown-1.13.1 lib/kramdown/converter/math_engine/ritex.rb
kramdown-1.13.0 lib/kramdown/converter/math_engine/ritex.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/kramdown-1.12.0/lib/kramdown/converter/math_engine/ritex.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/kramdown-1.12.0/lib/kramdown/converter/math_engine/ritex.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/kramdown-1.12.0/lib/kramdown/converter/math_engine/ritex.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/kramdown-1.12.0/lib/kramdown/converter/math_engine/ritex.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/kramdown-1.12.0/lib/kramdown/converter/math_engine/ritex.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/kramdown-1.12.0/lib/kramdown/converter/math_engine/ritex.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/kramdown-1.12.0/lib/kramdown/converter/math_engine/ritex.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/kramdown-1.12.0/lib/kramdown/converter/math_engine/ritex.rb
kramdown-1.12.0 lib/kramdown/converter/math_engine/ritex.rb
kramdown-1.11.1 lib/kramdown/converter/math_engine/ritex.rb
kramdown-1.11.0 lib/kramdown/converter/math_engine/ritex.rb