diff options
-rw-r--r-- | src/mumble/MainWindow.cpp | 4 | ||||
-rw-r--r-- | src/mumble/Markdown.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp index 6d955c9d6..d7cb33815 100644 --- a/src/mumble/MainWindow.cpp +++ b/src/mumble/MainWindow.cpp @@ -1952,6 +1952,10 @@ void MainWindow::on_qaQuit_triggered() { void MainWindow::sendChatbarText(QString qsText) { qsText = qsText.toHtmlEscaped(); + // Markdown::markdownToHTML also takes care of replacing line breaks (\n) with the respective + // HTML code <br/>. Therefore if Markdown support is ever going to be removed from this + // function, this job has to be done explicitly as otherwise line breaks won't be shown on + // the receiving end of this text message. qsText = Markdown::markdownToHTML(qsText); sendChatbarMessage(qsText); diff --git a/src/mumble/Markdown.cpp b/src/mumble/Markdown.cpp index 3f60acb77..053ed3963 100644 --- a/src/mumble/Markdown.cpp +++ b/src/mumble/Markdown.cpp @@ -351,7 +351,7 @@ QString markdownToHTML(const QString &markdownInput) { // Replace linebreaks afterwards in order to not mess up the RegEx used by the // different functions. static const QRegularExpression s_lineBreakRegEx(QLatin1String("\r\n|\n|\r")); - htmlString.replace(s_lineBreakRegEx, QLatin1String("</br>")); + htmlString.replace(s_lineBreakRegEx, QLatin1String("<br/>")); // Resore linebreaks in <pre> blocks htmlString.replace(regularLineBreakPlaceholder, QLatin1String("\n")); |