mirror of
https://github.com/zadam/trilium.git
synced 2025-10-09 23:18:46 +08:00
fix importing inline images within markdown within zip, closes #4301
This commit is contained in:
parent
9db0a062ed
commit
9665e872c2
1 changed files with 5 additions and 0 deletions
|
@ -327,6 +327,11 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
|
||||||
content = content.replace(/<\/body>.*<\/html>/gis, "");
|
content = content.replace(/<\/body>.*<\/html>/gis, "");
|
||||||
|
|
||||||
content = content.replace(/src="([^"]*)"/g, (match, url) => {
|
content = content.replace(/src="([^"]*)"/g, (match, url) => {
|
||||||
|
if (url.startsWith("data:image")) {
|
||||||
|
// inline images are parsed and saved into attachments in the note service
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
url = decodeURIComponent(url).trim();
|
url = decodeURIComponent(url).trim();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue