<div dir="ltr">I think if you put this code before \begin{document} and after loading bidi package, the issue goes away:<br><br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<div dir="ltr">%%%%%%%<br>

<p style="margin: 0px; text-indent: 0px;">\makeatletter</p>
<p style="margin: 0px; text-indent: 0px;">\def \@setminipage{%</p>
<p style="margin: 0px; text-indent: 0px;">  \@minipagetrue</p>
<p style="margin: 0px; text-indent: 0px;">  \everypar{\@minipagefalse\everypar{}\if@RTL\beginR\else\beginL\fi}%</p>
<p style="margin: 0px; text-indent: 0px;">}</p>
<p style="margin: 0px; text-indent: 0px;">\makeatother</p><p style="margin: 0px; text-indent: 0px;">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">
A similar bug for \parbox existed, that I just fixed in the repository.</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">
Please let me know if you can find any other issue and thanks for your bug report.</p></div><br clear="all"><br>-- <br>Best wishes,<br>Vafa Khalighi<br>
</div>