Skip to content

Commit

Permalink
pbek/QOwnNotes#3101 fix: malfunctioning ordered list detection in hea…
Browse files Browse the repository at this point in the history
…ding highlighting

Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
  • Loading branch information
pbek committed Sep 10, 2024
1 parent 48d602b commit 6fc275f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions markdownhighlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,12 @@ static bool isParagraph(const QString &text) {
else
break;
}
if (textView[i] == QLatin1Char('.') ||
textView[i] == QLatin1Char(')')) {
return false;
if (i < textView.size() &&
(textView[i] == QLatin1Char('.') || textView[i] == QLatin1Char(')'))) {
// Check if there's a next character and if it's a space
if (i + 1 < textView.size() && textView[i + 1].isSpace()) {
return false;
}
}
}

Expand Down

0 comments on commit 6fc275f

Please sign in to comment.