- def self.expand(template, nodes)
- nodes.map do |node|
- if node.kind_of?(Hash)
- template.gsub(/%%([^%]+)%%/) { node[$1.to_sym] }
+ def self.expand(template, nodes, separator = " ")
+ nodes.map do |node|
+ if node.is_a?(Hash)
+ template
+ .gsub(/%%%([^%]+)%%%/) { node[Regexp.last_match[1].to_sym].tr("-", "_") }
+ .gsub(/%%([^%]+)%%/) { node[Regexp.last_match[1].to_sym] }