diff --git a/src/chatlog/textformatter.cpp b/src/chatlog/textformatter.cpp
index 48a2aa0a8..fc9c67ae2 100644
--- a/src/chatlog/textformatter.cpp
+++ b/src/chatlog/textformatter.cpp
@@ -23,46 +23,56 @@
// clang-format off
-/* Easy way to get count of markdown symbols - through length of substring, captured by regex group.
+/* Easy way to get count of markdown symbols - through length of substring, captured by reex group.
* If you suppose to change regexes, assure that this const points to right group.
*/
static constexpr uint8_t MARKDOWN_SYMBOLS_GROUP_INDEX = 1;
-static const QString SINGLE_SIGN_PATTERN = QStringLiteral("(?<=^|\\s|\\n)"
+static const QString SINGLE_SIGN_PATTERN = QStringLiteral("(?<=^|[\\s\\n])"
"([%1])"
"(?!\\s)"
- "[^%1\\n]+"
+ "[^%1\\n]+?"
"(? REGEX_TO_WRAPPER[] {
- {QRegularExpression(SINGLE_SIGN_PATTERN.arg('*')), "%1"},
- {QRegularExpression(SINGLE_SIGN_PATTERN.arg('/')), "%1"},
- {QRegularExpression(SINGLE_SIGN_PATTERN.arg('_')), "%1"},
- {QRegularExpression(SINGLE_SIGN_PATTERN.arg('~')), "%1"},
- {QRegularExpression(SINGLE_SIGN_PATTERN.arg('`')),"%1
"},
- {QRegularExpression(DOUBLE_SIGN_PATTERN.arg('*')), "%1"},
- {QRegularExpression(DOUBLE_SIGN_PATTERN.arg('/')), "%1"},
- {QRegularExpression(DOUBLE_SIGN_PATTERN.arg('_')), "%1"},
- {QRegularExpression(DOUBLE_SIGN_PATTERN.arg('~')), "%1"},
- {QRegularExpression(MULTILINE_CODE), "%1
"}};
+ {QRegularExpression(SINGLE_SLASH_PATTERN), QStringLiteral("%1")},
+ {QRegularExpression(SINGLE_SIGN_PATTERN.arg('*')), QStringLiteral("%1")},
+ {QRegularExpression(SINGLE_SIGN_PATTERN.arg('_')), QStringLiteral("%1")},
+ {QRegularExpression(SINGLE_SIGN_PATTERN.arg('~')), QStringLiteral("%1")},
+ {QRegularExpression(SINGLE_SIGN_PATTERN.arg('`')), QStringLiteral(""
+ "%1
")},
+ {QRegularExpression(DOUBLE_SIGN_PATTERN.arg('*')), QStringLiteral("%1")},
+ {QRegularExpression(DOUBLE_SIGN_PATTERN.arg('/')), QStringLiteral("%1")},
+ {QRegularExpression(DOUBLE_SIGN_PATTERN.arg('_')), QStringLiteral("%1")},
+ {QRegularExpression(DOUBLE_SIGN_PATTERN.arg('~')), QStringLiteral("%1")},
+ {QRegularExpression(MULTILINE_CODE), QStringLiteral(""
+ "%1
")}};
static const QString HREF_WRAPPER = QStringLiteral(R"(%1)");