Class: Jekyll::Quicklatex::Block

Inherits:
Liquid::Block
  • Object
show all
Defined in:
lib/jekyll/quicklatex.rb

Defined Under Namespace

Classes: Cache

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, markup, tokens) ⇒ Block

Returns a new instance of Block.



9
10
11
12
# File 'lib/jekyll/quicklatex.rb', line 9

def initialize tag_name, markup, tokens
  super
  init_param
end

Instance Method Details

#join_back(lines) ⇒ Object



92
93
94
# File 'lib/jekyll/quicklatex.rb', line 92

def join_back(lines)
  lines.join('').gsub(/%/, '%25').gsub(/&/, '%26')
end

#render(context) ⇒ Object



14
15
16
17
18
19
# File 'lib/jekyll/quicklatex.rb', line 14

def render(context)
  @output_dir = context.registers[:site].config['destination']
  snippet = filter_snippet(super)
  url = remote_compile snippet
  "<img src='/#{@saved_dir}#{url}' onerror='this.onerror=null; this.src=\"http://quicklatex.com#{url}\"' />#{super}"
end