allow inheritable to be sent through as a tag

This commit is contained in:
Dirk Kelly 2011-03-02 08:15:54 +08:00
parent 04b0849dc5
commit 77d7587150
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,7 @@ module Locomotive
def initialize(tag_name, markup, tokens, context)
if markup =~ Syntax
@slug = $1.gsub('\'', '')
@options = {}
@options = { :inheritable => true }
markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/^'/, '').gsub(/'$/, '') }
else
raise ::Liquid::SyntaxError.new("Syntax Error in 'editable_xxx' - Valid syntax: editable_xxx <slug>(, <options>)")
@ -27,6 +27,7 @@ module Locomotive
:slug => @slug,
:hint => @options[:hint],
:default_content => @nodelist.first.to_s,
:inheritable => @options[:inheritable],
:disabled => false,
:from_parent => false
}, document_type)