summary refs log tree commit diff
path: root/src/Utils.cpp
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-09-13 11:02:54 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-09-13 11:02:54 +0300
commitbf4d559523e956523a617213fa1cc3c36fab24e4 (patch)
tree58155f4efbb364dab13245313d742a846ed6f51e /src/Utils.cpp
parentUse <em></em> for m.emote messages (diff)
downloadnheko-bf4d559523e956523a617213fa1cc3c36fab24e4.tar.xz
Strip paragraph tags
fixes #438
Diffstat (limited to '')
-rw-r--r--src/Utils.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp

index 5a0558f4..308c0af9 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp
@@ -350,11 +350,11 @@ utils::markdownToHtml(const QString &text) // The buffer is no longer needed. free((char *)tmp_buf); - return QString::fromStdString(html).trimmed(); -} + auto result = QString::fromStdString(html).trimmed(); -std::string -utils::stripHtml(const QString &text) -{ - return text.trimmed().remove(QRegExp("<[^>]*>")).toStdString(); + // Strip paragraph tags. + result.replace("<p>", ""); + result.replace("</p>", ""); + + return result; }