Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2021-04-03 15:24:11 +0300
committerGitHub <noreply@github.com>2021-04-03 15:24:11 +0300
commite0d005699e7032f661a822226ea16dcb41ca0522 (patch)
tree46dca886fc850877ae2e68e54a96dffb4946e4fc
parentc81d1903e1b7b6da78ea8ec8f292e0b06de9815b (diff)
parent0a95dea3e14cd2981dde152fb2337dd2716b21a1 (diff)
Merge pull request #4902: FIX(client, markdown): Wrong line break HTML code1.4.0-development-snapshot-004
The Markdown code was using </br> instead of the correct <br/>. This error was introduced in 2da3f0d. Fixes #4899
-rw-r--r--src/mumble/MainWindow.cpp4
-rw-r--r--src/mumble/Markdown.cpp2
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"));