Skip to content

Commit

Permalink
Merge PR #6298: FIX(client): Invalid code-block regex
Browse files Browse the repository at this point in the history
Turns out that the regex introduced in #6261 was using syntax that Qt doesn't support.

Therefore, the regex has been replaced with a valid one that should be functionally identical.
  • Loading branch information
Krzmbrzl authored Jan 1, 2024
2 parents 96f2581 + 7014fdc commit be3773f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mumble/Markdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ bool processMarkdownInlineCode(QString &str, int &offset) {
bool processMarkdownCodeBlock(QString &str, int &offset) {
// Code blocks are marked as ```code```
// Also consume a potential following newline as the <pre> tag will cause a linebreak anyways
static const QRegularExpression s_regex(QLatin1String("```.*\\n([^]*?)```(\\r\\n|\\n|\\r)?"));
static const QRegularExpression s_regex(QLatin1String("```.*\\n((?:[^`]|``?[^`]?)*)```(\\r\\n|\\n|\\r)?"));

QRegularExpressionMatch match =
s_regex.match(str, offset, QRegularExpression::NormalMatch, QRegularExpression::AnchoredMatchOption);
Expand Down

0 comments on commit be3773f

Please sign in to comment.