<div dir="ltr">after playing with colors for a while, I came with a trick done in math mode that allows color spanning multiple lines in RTL mode. so an example is:<br><br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">\documentclass{article}</p>
<p style="margin: 0px; text-indent: 0px;">\usepackage{color}</p>
<p style="margin: 0px; text-indent: 0px;">\usepackage[RTLdocument]{bidi}</p>
<p style="margin: 0px; text-indent: 0px;">\begin{document}</p>
<p style="margin: 0px; text-indent: 0px;">${\color{red}\hbox{\vbox{This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test test This is a test }}}$ <br>
</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">This is a test</p>
<p style="margin: 0px; text-indent: 0px;">\end{document}</p><br>With this, the color in RTL mode behaves correctly spanning multiple lines. I think it seems a good idea to improve this. ofcourse with this tricks, I do not think we could avoid <br>
<br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">Overfull \hbox (15.0pt too wide) in paragraph at lines 5--6</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;">But that is not much important. TeX can complain as much as it likes; I do not care since color issue is fixed.<br>
</p><br><br>Any ideas?<br clear="all"><br>-- <br>Vafa<br>
</div>