Considering the following parsed template and a loop to its root.nodelist:
text = '{% if true %}{{ "poland" | capitalize }}{% else %}{{ "portugal" | capitalize}}{% endif %}'
template = Liquid::Template.parse(text)
template.root.nodelist.each { |node| p node }
will print only:
Portugal
(and not Poland)
How could one list all nodes (including Liquid variables, tags, etc) from a template? Especially those inside if/else logic?