mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-11 07:29:38 -05:00
Merge pull request #1957 from PhenomRetroShare/Fix_IndentInChatMessage
Fix Indent in Chat Message
This commit is contained in:
commit
e460a02f54
@ -31,6 +31,8 @@
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "util/ObjectPainter.h"
|
||||
#include "util/imageutil.h"
|
||||
|
||||
#include "util/rsdebug.h"
|
||||
#include "util/rstime.h"
|
||||
|
||||
#ifdef USE_CMARK
|
||||
@ -40,6 +42,8 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
//#define DEBUG_SAVESPACE 1
|
||||
|
||||
/**
|
||||
* The type of embedding we'd like to do
|
||||
*/
|
||||
@ -554,17 +558,23 @@ static QString saveSpace(const QString text)
|
||||
if(cursChar==QLatin1Char('>')) {
|
||||
if(!echapChar && i>0) {outBrackets=true; firstOutBracket=true;}
|
||||
} else if(cursChar==QLatin1Char('\t')) {
|
||||
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, " ");
|
||||
if(outBrackets && firstOutBracket && (keyName!="style")) { savedSpaceText.replace(i, 1, " "); i+= 11; }
|
||||
} else if(cursChar==QLatin1Char(' ')) {
|
||||
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, " ");
|
||||
if(outBrackets && firstOutBracket && (keyName!="style")) { savedSpaceText.replace(i, 1, " "); i+= 5; }
|
||||
} else if(cursChar==QChar(0xA0)) {
|
||||
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, " ");
|
||||
if(outBrackets && firstOutBracket && (keyName!="style")) { savedSpaceText.replace(i, 1, " "); i+= 5; }
|
||||
} else if(cursChar==QLatin1Char('<')) {
|
||||
if(!echapChar) {outBrackets=false; getKeyName=true; keyName.clear();}
|
||||
} else firstOutBracket=false;
|
||||
echapChar=(cursChar==QLatin1Char('\\'));
|
||||
|
||||
}
|
||||
#ifdef DEBUG_SAVESPACE
|
||||
RsDbg() << __PRETTY_FUNCTION__ << "Text to save:" << std::endl
|
||||
<< text.toStdString() << std::endl
|
||||
<< "---------------------- Saved Text:" << std::endl
|
||||
<< savedSpaceText.toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
return savedSpaceText;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user