lib/undies/node.rb in undies-2.0.0 vs lib/undies/node.rb in undies-2.1.0

- old
+ new

@@ -9,16 +9,22 @@ def self.content(node) node.instance_variable_get("@content") end def self.flush(output, node) + output.pp_use_indent = true if node.force_pp? output << self.content(node) end - def initialize(content) + def initialize(content, opts={}) @start_tag = nil @end_tag = nil + @force_pp = opts[:force_pp] @content = content + end + + def force_pp? + !!@force_pp end def ==(other_node) self.class.content(self) == other_node.class.content(other_node) && self.instance_variable_get("@start_tag") == other_node.instance_variable_get("@start_tag") &&