mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 15:45:04 -04:00
Fixed message reply and forward.
The new lines were removed falsely. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4815 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8a86c980fc
commit
80a20b41a3
3 changed files with 17 additions and 3 deletions
|
@ -269,4 +269,17 @@ void optimizeHtml(QTextEdit *textEdit, QString &text)
|
|||
std::cerr << "Optimized text to " << text.length() << " bytes , instead of " << textEdit->toHtml().length() << std::endl;
|
||||
}
|
||||
|
||||
QString toHtml(QString text, bool realHtml)
|
||||
{
|
||||
// replace "\n" from the optimized html with "<br>"
|
||||
text.replace("\n", "<br>");
|
||||
if (!realHtml) {
|
||||
return text;
|
||||
}
|
||||
|
||||
QTextDocument doc;
|
||||
doc.setHtml(text);
|
||||
return doc.toHtml();
|
||||
}
|
||||
|
||||
} // namespace RsHtml
|
||||
|
|
|
@ -113,7 +113,8 @@ extern EmbedInHtmlImg defEmbedImg;
|
|||
QString formatText(const QString &text, unsigned int flag);
|
||||
bool findAnchors(const QString &text, QStringList& urls);
|
||||
|
||||
void optimizeHtml(QTextEdit *textEdit, QString &text);
|
||||
void optimizeHtml(QTextEdit *textEdit, QString &text);
|
||||
QString toHtml(QString text, bool realHtml = true);
|
||||
|
||||
} // namespace RsHtml
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue