diff --git a/markdownhighlighter.cpp b/markdownhighlighter.cpp index c47957a..81fb24c 100644 --- a/markdownhighlighter.cpp +++ b/markdownhighlighter.cpp @@ -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; + } } }