From 277f31a529f7192593f2b8c10292743eb814e1d9 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Fri, 15 Sep 2023 13:15:55 +0200 Subject: [PATCH] test: try UseUnicodePropertiesOption --- src/entities/note.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/entities/note.cpp b/src/entities/note.cpp index 4f62c209fb..dc88763aae 100644 --- a/src/entities/note.cpp +++ b/src/entities/note.cpp @@ -1562,22 +1562,26 @@ bool Note::handleNoteTextFileName() { static const QRegularExpression re( QStringLiteral( R"(^---((\r\n)|(\n\r)|\r|\n).+?((\r\n)|(\n\r)|\r|\n)---((\r\n)|(\n\r)|\r|\n))"), - QRegularExpression::DotMatchesEverythingOption); + QRegularExpression::DotMatchesEverythingOption | QRegularExpression::UseUnicodePropertiesOption); noteText.remove(re); } // remove html comment from start of markdown text if (noteText.startsWith(QLatin1String("((\r\n)|(\n\r)|\r|\n))"), - QRegularExpression::DotMatchesEverythingOption); + QRegularExpression::DotMatchesEverythingOption | QRegularExpression::UseUnicodePropertiesOption); noteText.remove(re); } // split the text into a string list - static const QRegularExpression re(QStringLiteral(R"((\r\n)|(\n\r)|\r|\n)")); + static const QRegularExpression re(QStringLiteral(R"((\r\n)|(\n\r)|\r|\n)"), QRegularExpression::UseUnicodePropertiesOption); const QStringList noteTextLines = noteText.trimmed().split(re); const int noteTextLinesCount = noteTextLines.count(); + qDebug() << __func__ << " - 'noteTextLinesCount': " << noteTextLinesCount; + + qDebug() << __func__ << " - 'noteTextLines': " << noteTextLines; + // do nothing if there is no text if (noteTextLinesCount == 0) { return false;