$ echo '[[File:Foo.jpg|thumb|thecaption]]' | tests/parse.js --normalize=parsoid | sed -e 's/thecaption/|/' | tests/parse.js --html2wt [[File:Foo.jpg|thumb|<nowiki>|</nowiki>]]
But if you remove "thumb":
$ echo '[[File:Foo.jpg|thecaption]]' | tests/parse.js --normalize=parsoid | sed -e 's/thecaption/|/' | tests/parse.js --html2wt [[File:Foo.jpg||]]
The caption embedded in the data-mw property is not being properly nowiki-escaped.