Module: Kramdown::Converter::MathEngine::Mathjax

### Home Classes Methods

### In Files

- lib/kramdown/converter/math_engine/mathjax.rb

### Methods

- ::call

### Class/Module Index

Quicksearch

- Kramdown
- Kramdown::Converter
- Kramdown::Converter::Base
- Kramdown::Converter::Html
- Kramdown::Converter::Kramdown
- Kramdown::Converter::Latex
- Kramdown::Converter::MathEngine
- Kramdown::Converter::MathEngine::Itex2MML
- Kramdown::Converter::MathEngine::Mathjax
- Kramdown::Converter::MathEngine::Ritex
- Kramdown::Converter::RemoveHtmlTags
- Kramdown::Converter::SyntaxHighlighter
- Kramdown::Converter::SyntaxHighlighter::Coderay
- Kramdown::Converter::SyntaxHighlighter::Rouge
- Kramdown::Converter::Toc
- Kramdown::Document
- Kramdown::Element
- Kramdown::Error
- Kramdown::Options
- Kramdown::Options::Boolean
- Kramdown::Parser
- Kramdown::Parser::Base
- Kramdown::Parser::GFM
- Kramdown::Parser::Html
- Kramdown::Parser::Html::Constants
- Kramdown::Parser::Html::ElementConverter
- Kramdown::Parser::Html::Parser
- Kramdown::Parser::Kramdown
- Kramdown::Parser::Markdown
- Kramdown::Utils
- Kramdown::Utils::Configurable
- Kramdown::Utils::Entities
- Kramdown::Utils::Entities::Entity
- Kramdown::Utils::Html
- Kramdown::Utils::OrderedHash
- Kramdown::Utils::StringScanner
- Kramdown::Utils::Unidecoder

No matching classes.

# Kramdown::Converter::MathEngine::Mathjax

Uses the MathJax javascript library for displaying math.

Note that the javascript library itself is not include or linked, this has to be done separately. Only the math content is marked up correctly.

### Public Class Methods

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

    # File lib/kramdown/converter/math_engine/mathjax.rb, line 17
    def self.call(converter, el, opts)
      type = el.options[:category]
      text = (el.value =~ /<|&/ ? "% <![CDATA[\n#{el.value} %]]>" : el.value)
      text.gsub!(/<\/?script>?/, '')

      attr = {:type => "math/tex#{type == :block ? '; mode=display' : ''}"}
      if type == :block
        converter.format_as_block_html('script', attr, text, opts[:indent])
      else
        converter.format_as_span_html('script', attr, text)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.