Skip to content

Commit

Permalink
#3104 fix: detection of name of link for bookmarks in checkbox list item
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Sep 11, 2024
1 parent 255ab7e commit c654001
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# QOwnNotes Changelog

## 24.9.5
- The name detection of links in checkbox list item for bookmarks for the
[Web Companion browser extension](https://github.com/qownnotes/web-companion)
was improved (for [#3104](https://github.com/pbek/QOwnNotes/issues/3104))
## 24.9.4
- An issue with the **backlink widget** showing duplicate items panel was fixed
(for [#1717](https://github.com/pbek/QOwnNotes/issues/1717))
Expand Down
4 changes: 2 additions & 2 deletions src/entities/bookmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ QVector<Bookmark> Bookmark::parseBookmarks(const QString &text, bool withBasicUr

// parse bookmark links like `- [name](http://link) #tag1 #tag2 the
// description text` with optional tags and description
i = QRegularExpression(QStringLiteral(R"([-*]\s+\[(.+?)\]\(([\w-]+://.+?)\)(.*)$)"),
i = QRegularExpression(QStringLiteral(R"([-*]\s+\[([^\[\]]+?)\]\(([\w-]+://.+?)\)(.*)$)"),
QRegularExpression::MultilineOption)
.globalMatch(text);

Expand Down Expand Up @@ -102,7 +102,7 @@ QVector<Bookmark> Bookmark::parseBookmarks(const QString &text, bool withBasicUr

if (withBasicUrls) {
// parse named links like [name](http://my.site.com)
i = QRegularExpression(QStringLiteral(R"(\[(.+?)\]\(([\w-]+://.+?)\))")).globalMatch(text);
i = QRegularExpression(QStringLiteral(R"(\[([^\[\]]+?)\]\(([\w-]+://.+?)\))")).globalMatch(text);

while (i.hasNext()) {
QRegularExpressionMatch match = i.next();
Expand Down

0 comments on commit c654001

Please sign in to comment.