Class: LiquidPlus::Include

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll-liquid-plus/helpers/include.rb

Constant Summary collapse

LOCALS =
/(.*?)(([\w-]+)\s*=\s*(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+)))(.*)?/

Class Method Summary collapse

Class Method Details

.render(markup, context) ⇒ Object



8
9
10
11
# File 'lib/jekyll-liquid-plus/helpers/include.rb', line 8

def render(markup, context)
  tag = IncludeTag.new('include', markup, [])
  tag.render(context)
end

.split_params(markup) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/jekyll-liquid-plus/helpers/include.rb', line 13

def split_params(markup)
  params = nil
  if markup =~ LOCALS
    params = ' ' + $2
    markup = $1 + $7
  end
  [markup, params]
end