Class: Katex2HTML::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/katex2html/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(html, options = {}) ⇒ Parser

Returns a new instance of Parser.



3
4
5
6
7
# File 'lib/katex2html/parser.rb', line 3

def initialize(html, options = {})
  @options = default_opts.merge(options)
  @html = html
  @render = Renderer.new(options)
end

Instance Method Details

#parseObject



9
10
11
12
13
14
15
# File 'lib/katex2html/parser.rb', line 9

def parse
  each_delimiter do |*args|
    @html = convert_latex_to_katex(*args)
    @html = process_escapes(*args) if @options[:process_escapes]
    @html
  end
end