lib/polytexnic/preprocessors/polytex.rb
# Restores the Markdown math.
# This is easy because we're running everything through our LaTeX
# pipeline.
Restores the Markdown math.
This is easy because we're running everything through our LaTeX
pipeline.
Restores the Markdown math . This is easy because we ' re running everything through our LaTeX pipeline .
def restore_math(text, cache)
        cache.each do |(kind, key), value|
          case kind
          when :inline
            open  = '\('
            close =  '\)'
          when :block
            open  = '\['
            close = '\]'
          end
          text.gsub!(key, open + value + close)
        end
      end
def restore_math ( text , cache ) cache . each do | ( kind , key ) , value | case kind when :inline open = '\(' close = '\)' when :block open = '\[' close = '\]' end text . gsub! ( key , open + value + close ) end end
Restores the Markdown math.
Restores the Markdown math .
text
cache