Hi ! Jon Keating wrote: > Update of /cvsroot/licq/qt-gui/src > In directory sc8-pr-cvs1:/tmp/cvs-serv8481 > > Modified Files: > ewidgets.cpp mlview3.cpp mlview3.h > Log Message: > Only interpret HTML tags for AIM accounts. ICQ won't use > HTML. Should fix the problem everyone is complaining about these > days ;)
Thanks a lot for fixing this issue but unfortunately you deactivated escaping of linebreaks too. Could you please apply the attached patch to fix this? thanks Sönke
--- plugins/qt-gui/src/mlview3.cpp 13 Jan 2004 18:05:05 -0000 1.17 +++ plugins/qt-gui/src/mlview3.cpp 14 Jan 2004 20:42:59 -0000 @@ -85,13 +85,14 @@ gMainWindow->emoticons->ParseMessage(text); + int pos = 0; if (useHTML) { // We must hightlight URLs at this step, before we convert // linebreaks to richtext tags and such. Also, check to make sure // that the text is not prepared to be highlighted already (by AIM). QRegExp reAHREF("<a href", false); - int pos = 0; + pos = 0; if (highlightURLs && (pos = text.find(reAHREF, pos)) == -1) { QRegExp reURL("(\\w+://.+)(\\s+|$)"); @@ -115,22 +116,22 @@ } } - - text.replace(QRegExp("\n"), "<br>\n"); - // We keep the first space character as-is (to allow line wrapping) - // and convert the next characters to s (to preserve multiple - // spaces). - QRegExp longSpaces(" ([ ]+)"); - pos = 0; - QString cap; - while ((pos = longSpaces.search(text)) > -1) - { - cap = longSpaces.cap(1); - cap.replace(QRegExp(" "), " "); - text.replace(pos+1, longSpaces.matchedLength()-1, cap); - } - text.replace(QRegExp("\t"), " "); } + + text.replace(QRegExp("\n"), "<br>\n"); + // We keep the first space character as-is (to allow line wrapping) + // and convert the next characters to s (to preserve multiple + // spaces). + QRegExp longSpaces(" ([ ]+)"); + pos = 0; + QString cap; + while ((pos = longSpaces.search(text)) > -1) + { + cap = longSpaces.cap(1); + cap.replace(QRegExp(" "), " "); + text.replace(pos+1, longSpaces.matchedLength()-1, cap); + } + text.replace(QRegExp("\t"), " "); return text; }