fix fence close regex: only match backtick on its own line

This commit is contained in:
Levi Neely 2026-08-03 00:27:25 +02:00
parent b841f556d4
commit cf4313165b
1 changed files with 1 additions and 1 deletions

View File

@ -194,7 +194,7 @@ QString ChatBlockModel::highlightCode(const QString &code, const QString &langua
QString ChatBlockModel::renderMarkdown(const QString &markdown) const
{
static const QRegularExpression fenceRe(
R"(```([A-Za-z0-9_+.-]*)[^\n]*\n([\s\S]*?)```)");
R"(```([A-Za-z0-9_+.-]*)[^\n]*\n([\s\S]*?)\n```(\n|$))");
QString result;
int cursor = 0;