Skip to content

Commit

Permalink
test: try UseUnicodePropertiesOption
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Sep 15, 2023
1 parent cce8380 commit 277f31a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/entities/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("<!--"))) {
static const QRegularExpression re(QStringLiteral(R"(^<!--.+?-->((\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;
Expand Down

0 comments on commit 277f31a

Please sign in to comment.