Imagine the following code:
whaffle1<bdo><bdi>rtl</bdi></bdo>whaffle2[[File:example.png|thumb]]whaffle3
That will be broken into
<p> whaffle1 </p> <bdo><bdi>rtl</bdi></bdo> <p> whaffle2 </p> <img> <p> whaffle3 </p>
Note that both <bdo> and <bdi> are flow content HTML. They are used here as a browser-safe approach to break UBA without insertion of additional bidi characters.
The thumbnail is breaking the parser. The following works as expected within a consecutive first paragraph:
whaffle1<bdo><bdi>rtl</bdi></bdo>whaffle2 [[File:example.png|thumb]] whaffle3
See Template Talk:HeS on dewiki for rendering example.
Occurring on dewiki under Remex conditions.