Skip to content

Commit

Permalink
Update QMarkdownTextEdit::handleBracketClosing to fix issue caused by
Browse files Browse the repository at this point in the history
  • Loading branch information
com3dian authored Aug 5, 2024
1 parent 48d602b commit 22cc3ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qmarkdowntextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,9 @@ bool QMarkdownTextEdit::handleBracketClosing(const QChar openingCharacter,

const int pib = cursor.positionInBlock();
bool isPreviousAsterisk = pib > 0 && pib < text.length() && text.at(pib - 1) == '*';
bool isNextAsterisk = pib < text.length() && text.at(pib) == '*';
bool isNextAsterisk = pib >0 && pib < text.length() && text.at(pib) == '*';
bool isMaybeBold = isPreviousAsterisk && isNextAsterisk;
if (pib < text.length() && !isMaybeBold && !text.at(pib).isSpace()) {
if (pib > 0 && pib < text.length() && !isMaybeBold && !text.at(pib).isSpace()) {
return false;
}

Expand Down

0 comments on commit 22cc3ff

Please sign in to comment.