See this transcript:
$ echo "[[<div>[{{1x|foo}}]</div>]]" | php bin/parse.php <p data-parsoid='{"dsr":[0,27,0,0]}'>[[<div>[<span about="#mwt3" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]],"dsr":[8,18,null,null]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</span>]]]</p>
We are processing the div tags as text!
The above is a reduced test case for the busted output seen on https://nov.wikipedia.org/wiki/Template%3ACountry?useparsoid=1
