Skip to content

Commit

Permalink
Fixed URL character detection
Browse files Browse the repository at this point in the history
  • Loading branch information
medo64 committed Mar 14, 2021
1 parent 843c547 commit 6488b52
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/storage/fileitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,14 @@ QString FileItem::findAnchorAt(QPoint pos) {
int startAt = 0;
int endAt = blockText.length();
for (int i = 0; i < blockText.length(); i++) {
if (blockText.at(i).isSpace()) {
QChar ch = blockText.at(i);
bool isUrlChar = ch.isLetterOrNumber()
|| (ch == '-')
|| (ch == '.')
|| (ch == '_')
|| (ch == '~')
|| (ch == '%');
if (!isUrlChar) {
if (i < charPosition) {
startAt = i + 1;
} else {
Expand Down

0 comments on commit 6488b52

Please sign in to comment.