Sha256: bd0f37c50225391223898918aa2a93ff978caefc0212b3c86afdc29bb8c6436f
Contents?: true
Size: 638 Bytes
Versions: 8
Compression:
Stored size: 638 Bytes
Contents
# Unless run with ReverseAsciidoctor.config.mathml2asciimath, # this is cheating: we're injecting MathML into Asciidoctor, but # Asciidoctor only understands AsciiMath or LaTeX require "mathml2asciimath" module ReverseAsciidoctor module Converters class Math < Base 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 end register :math, Math.new end end
Version data entries
8 entries across 8 versions & 2 rubygems