fix fence close regex: only match backtick on its own line
This commit is contained in:
parent
b841f556d4
commit
cf4313165b
|
|
@ -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;
|
||||
|
|
|
|||
Reference in New Issue