Skip to content

Commit ac8b12c

Browse files
committed
#3419 joplinimportdialog: support image attributes
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent b095fce commit ac8b12c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## 26.1.2
44

5+
- The **Joplin Import Dialog** now supports importing image tags with attributes
6+
(for [#3419](https://github.com/pbek/QOwnNotes/issues/3419))
7+
- Image tags like `<img width="640" height="364" src=":/imageId"/>` are now properly recognized
8+
- Previously only simple `<img src=":/imageId"/>` tags without attributes were supported
59
- The **Joplin Import Dialog** now remembers the last selected directory
610
- The directory path is automatically restored when reopening the dialog
711
- The directory is only restored if it still exists on disk

src/dialogs/joplinimportdialog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ void JoplinImportDialog::handleImages(Note& note, const QString& dirPath) {
411411
importImage(note, dirPath, noteText, imageTag, imageId, imageName);
412412
}
413413

414-
i = QRegularExpression(R"(<img src=\":\/([\w\d]+)\"\/>)").globalMatch(noteText);
414+
i = QRegularExpression(R"(<img\s+(?:[^>]*\s+)?src=\":\/([\w\d]+)\"[^>]*\/?>)")
415+
.globalMatch(noteText);
415416

416417
while (i.hasNext()) {
417418
QRegularExpressionMatch match = i.next();

0 commit comments

Comments
 (0)