Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug report) Evernote import places images and attachments at end #3503

Closed
avidrissman opened this issue Jan 8, 2023 · 5 comments
Closed

Comments

@avidrissman
Copy link

Trilium Version

0.57.5

What operating system are you using?

Other Linux

What is your setup?

Server access only

Operating System Version

Docker, on a Synology

Description

Note Export.1.enex.zip
^ was generated by Evernote Legacy

When imported, this does not place the images in their correct location.

I have my suspicions as to why. In enex.js:

const mediaRegex = new RegExp(`<en-media hash="${hash}"[^>]*>`, 'g');

the regex matches en-media elements in which the hash attribute comes first. However, in this enex file, there is:

<en-media type="image/png" hash="bebf29eaebe00ea01693b4763c3484f1"/>

In other enexes (that are private and that I can’t share) I see:

<en-media style="--en-naturalWidth:1125; --en-naturalHeight:501;" hash="60ff10477080d28c820209a3f681c045" type="image/png" />
<en-media style="width: 160px; height: 120px;" hash="e4581e956a062139aed4788cc4b90009" type="audio/x-m4a" title="Attachment"/>

You may need to expand the regex you use.

Thanks for being so responsive!

Error logs

No response

@zadam
Copy link
Owner

zadam commented Jan 8, 2023

Thanks, fixed based on the sample import you provided.

@contributor
Copy link
Contributor

contributor commented Jan 9, 2023

All images are still at the bottom of the note.
Evernote:
image
Trilium:
image

In my case source of trilium note is the same either before and after f738787 applied over tag v0.57.5

<div>First line, first image follows</div>
<div></div>
<div>Second line, first image follows</div>
<div>
  <br>
</div>
<div></div>
<div>
  <br>
</div>
<img src="api/images/zQI3GBFdTIzx/Image.png">
<img src="api/images/WMRVotHpWxwY/image.png">

@contributor
Copy link
Contributor

Test enex file with the note above:
EnexImages.enex.zip

@zadam
Copy link
Owner

zadam commented Jan 9, 2023

There was another fix for this a couple of days ago. You need to use master branch.

<div>First line, first image follows</div>
<div>
  <img src="api/images/81sqKw2DqxyT/Image.png">
</div>
<div>Second line, first image follows</div>
<div>
  <br>
</div>
<div>
  <img src="api/images/PQePFzr2Wevb/image.png">
</div>
<div>
  <br>
</div>

@contributor
Copy link
Contributor

Included e40f1fd and now it works!

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants