Skip to content

Commit

Permalink
#1717 backlinks: don't detect checkboxes as part of links
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Sep 4, 2024
1 parent c9ecc3a commit d518efe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# QOwnNotes Changelog

## 24.9.2
- The **backlink widget** link detection was improved
(for [#1717](https://github.com/pbek/QOwnNotes/issues/1717))
- In checkbox lists the checkboxes will now not be detected as part of the links

## 24.9.1
- The **backlink widget** in the navigation panel now also shows the links in the notes
to the current note (for [#1717](https://github.com/pbek/QOwnNotes/issues/1717))
Expand Down
8 changes: 4 additions & 4 deletions src/entities/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3185,7 +3185,7 @@ QHash<Note, QList<BacklinkHit>> Note::findReverseLinkNotes() {
// search legacy links
addTextToBacklinkNoteHashIfFound(note, QStringLiteral("<") + noteUrl + QStringLiteral(">"));
addTextToBacklinkNoteHashIfFound(
note, QRegularExpression(QStringLiteral(R"(\[(.+)\]\()") +
note, QRegularExpression(QStringLiteral(R"(\[([^\[\]]+?)\]\()") +
QRegularExpression::escape(noteUrl) + QStringLiteral(R"(\))")));

// search for legacy links ending with "@"
Expand All @@ -3206,11 +3206,11 @@ QHash<Note, QList<BacklinkHit>> Note::findReverseLinkNotes() {
addTextToBacklinkNoteHashIfFound(
note, QStringLiteral("<") + relativeFilePath + QStringLiteral(">"));
addTextToBacklinkNoteHashIfFound(
note, QRegularExpression(QStringLiteral(R"(\[(.+)\]\()") +
note, QRegularExpression(QStringLiteral(R"(\[([^\[\]]+?)\]\()") +
QRegularExpression::escape(relativeFilePath) +
QStringLiteral(R"(\))")));
QStringLiteral(R"(\))"), QRegularExpression::MultilineOption));
addTextToBacklinkNoteHashIfFound(
note, QRegularExpression(QStringLiteral(R"(\[(.+)\]\()") +
note, QRegularExpression(QStringLiteral(R"(\[([^\[\]]+?)\]\()") +
QRegularExpression::escape(relativeFilePath) +
QStringLiteral(R"(#.+\))")));
}
Expand Down

0 comments on commit d518efe

Please sign in to comment.