Sha256: 31083f3a82ec78b342481b792e714c609196c63d573300440ee148683077ccf3

Contents?: true

Size: 385 Bytes

Versions: 9

Compression:

Stored size: 385 Bytes

Contents

require 'escape_utils'

module Gollum
  module Tex
    TEX_URL = "http://www.mathtran.org/cgi-bin/toy/"
    TEX_SIZES = { :inline => 2, :block => 4 }

    def self.to_html(tex, type = :inline)
      tex_uri = EscapeUtils.escape_uri(tex)
      tex_alt = EscapeUtils.escape_html(tex)
      %{<img src="#{TEX_URL}?D=#{TEX_SIZES[type]};tex=#{tex_uri}" alt="#{tex_alt}">}
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gollum-2.2.9 lib/gollum/tex.rb
gollum-2.2.8 lib/gollum/tex.rb
gollum-2.2.7 lib/gollum/tex.rb
gollum-2.2.6 lib/gollum/tex.rb
gollum-2.2.5 lib/gollum/tex.rb
gollum-2.2.4 lib/gollum/tex.rb
gollum-2.2.3 lib/gollum/tex.rb
gollum-2.2.2 lib/gollum/tex.rb
gollum-2.2.1 lib/gollum/tex.rb