Sha256: fd323ae89a1f3fa525eb3044b03599f9620ebea1879a6fc5ec9e43ab56b43762
Contents?: true
Size: 562 Bytes
Versions: 24
Compression:
Stored size: 562 Bytes
Contents
module Octopress module Ink module Helpers module Conditional SYNTAX = /(.*)\s(if|unless)\s(.+)/ def self.parse(markup, context) if markup =~ SYNTAX case $2 when 'if' tag = Liquid::If.new('if', $3, ["true","{% endif %}"]) when 'unless' tag = Liquid::Unless.new('unless', $3, ["true","{% endunless %}"]) end tag.render(context) != '' ? $1 : false else markup end end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems