@simplify causing img in p

@simplify causing img in p


So someone sent me an issue here https://instantview.telegram.org/contest/brodude.ru/template77/issue2/.

It's an interesting case, so I would rather write a long answer here.

The web page has a gallery inside unordered list along with some other text items.

Ok, not the most weird html code I've seen in this contest.

And it's this error stop IV from generating:

[..after:116] @simplify
Element <img> is not supported in <p>: <img width="1000" height="666" src="https://brodude.ru/wp-content/uploads/2014/12/brodude.ru_9.12.2014_o2azeuLUkUPMd.jpg" class="attachment-large size-large" alt="" srcset="https://brodude.ru/wp-content/uploads/2014/12/brodude.ru_9.12.2014_o2azeuLUkUPMd.jpg 1000w, https://brodude.ru/wp-content/uploads/2014/12/brodude.ru_9.12.2014_o2azeuLUkUPMd-300x200.jpg 300w" sizes="(max-width: 1000px) 100vw, 1000px"/>


But when I run @debug at the end of my template, I got zero p[.//img] nodes in body.

@debug: $body//p[.//img]
Debug 0 nodes

Then it could be @simplify causing problem here.

But since we can't use @simplify in our template, I just can't test it.

Would love to hear an answer from you.

Thanks.

Report Page