Version: 0.9.0 (using KDE 3.3.0, compiled sources) Compiler: gcc version 3.3.1 (SuSE Linux) OS: Linux (i686) release 2.4.21-243-default If one sends Two formulas: $$1+1=2$$ and $$a^2+b^2=c^2$$. then the LaTeX plugin will interpret "$$ and $$" as formula and ignore the rest. So one gets: Two formulas: $$1+1=2 [and] a^2+b^2=c^2$$. where [and] is "and" rendered as formula. Looking at the source, apparently using QRegExp rg("\\$\\$.+\\$\\$"); rg.setMinimal(true); doesn't work. Maybe it's even a bug in Qt (I'm using Qt 3.3.2) because it seems to ignore the first "$$".
No, it was a bug in the LaTeX plugin. The attached patch fixes the problem and also fixes the infinite loop Olivier worked around by adding a loop count. The fix is basically - rg.search(messageText, pos); + pos = rg.search(messageText, pos); The rest just removes some code which is obsolete, i.e. the count<30 workaround and the nonsensical if ( !match.length() ) because match will never have zero length if pos >= 0.
Created attachment 7401 [details] the proposed fix
I tested your patch, and seems to work verry fine. Thank you. If you have a CVS account, feel free to commit. If not, I can do it.
I've committed the fix to the 3.3 branch and to HEAD.