Skip to content

Commit

Permalink
Merge pull request #210 from pbek/revert-208-develop
Browse files Browse the repository at this point in the history
Revert "Update `QMarkdownTextEdit::handleBracketClosing` to fix #207"
  • Loading branch information
pbek authored Aug 5, 2024
2 parents a06cfb1 + 19d7c2c commit a9564de
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions qmarkdowntextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,8 @@ bool QMarkdownTextEdit::handleBracketClosing(const QChar openingCharacter,
// get the current text from the block (inserted character not included)
// Remove whitespace at start of string (e.g. in multilevel-lists).
const QString text = cursor.block().text().remove(QRegularExpression("^\\s+"));
// Subtract the length of leading whitespace
const int pib = cursor.positionInBlock() - (cursor.block().text().length() - text.length());

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 isMaybeBold = isPreviousAsterisk && isNextAsterisk;
Expand Down

0 comments on commit a9564de

Please sign in to comment.