lib/opulent/parser/node.rb in opulent-1.4.6 vs lib/opulent/parser/node.rb in opulent-1.4.7
- old
+ new
@@ -78,12 +78,14 @@
# error :self_enclosing_children, line
# end
# Create a clone of the definition model. Cloning the options is also
# necessary because it's a shallow copy
- if @inside_definition != node_name && @definitions.keys.include?(node_name)
+ if @definitions.keys.include?(node_name)
+ @definition_stack << node_name
parent[@children] << process_definition(node_name, current_node)
+ @definition_stack.pop
else
parent[@children] << current_node
end
end
end
@@ -109,10 +111,10 @@
end
def process_definition_child(node)
node[@children].map! do |child|
if child[@type] == :node
- if @definitions.keys.include? child[@value]
+ if !@definition_stack.include?(node[@value]) && @definitions.keys.include?(child[@value])
process_definition child[@value], child
else
process_definition_child child if child[@children]
child
end