Skip to content

Commit

Permalink
#3105 fix: remove \n sent by web companion when editing bookmark
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 c654001 commit 6b1d6fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
- 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))
- `\n` sent by the [Web Companion browser extension](https://github.com/qownnotes/web-companion)
while editing bookmarks will now be automatically removed to not break the
Markdown link (for [#3105](https://github.com/pbek/QOwnNotes/issues/3105))

## 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
5 changes: 4 additions & 1 deletion src/services/websocketserverservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,10 @@ int WebSocketServerService::editBookmark(const QJsonObject &jsonObject) {

// Get the "markdown" attribute from the "data" object
QString markdown = dataObject.value("markdown").toString().trimmed();
QString newMarkdown = dataObject.value("newMarkdown").toString().trimmed();

// Make sure there was no newline character in the string
// https://github.com/pbek/QOwnNotes/issues/3105
QString newMarkdown = dataObject.value("newMarkdown").toString().remove(QChar('\n')).trimmed();

if (markdown.isEmpty() || newMarkdown.isEmpty()) {
return 0;
Expand Down

0 comments on commit 6b1d6fd

Please sign in to comment.