As many of you are aware, Evernote's ENEX export format does not include note GUID's (unique note identifiers), so the note links in a referring note, e.g., evernote:///view/623444547/s234/3234284a05c-d67a-47af-c354-adad387102b3/3234284a05c-d67a-47af-c354-adad387102b3/
are pointing to a GUID that does not exist in the enex file or in any notes imported from an enex file. So perfect recreation of note links via enex is impossible.
However, in practice, most note links have note text that is exactly the same as the target note's title. This is because this is default behavior in Evernote. In Evernote, when you select a note (target note) and copy its internal link and paste into another note (referring note), what is pasted as the note link text is the title of the target note along with a hyperlink that is the EN GUID link. A user could edit the note link text so that it no longer matches the target note's title or edit the target note's title, but I would expect this occurs in only a small minority of note links.
Given the foregoing, it seems Joplin's enex importer could preserve the vast majority of Evernote note links by checking each imported note for a GUID link, searching note titles for that note link's text, and if target note is found, recreate the note link.
It's not "perfect" in that:
- it doesn't recreate note links in cases where note link text does not match title of target note (a small minority of cases). But no harm is done as nothing is changed, and user is no worse off than if this feature was never implemented.
- it may inadvertently create note links in cases where note link text matches title of note that is not the target note (an even smaller minority of cases than #1, where user edits the note link text such that it exactly matches another note's title). In this case, an inadvertent change is made in that you now have a link pointing to a note that is not the intended target note (as opposed to a link that points at something that doesn't exist).
But it would recreate most note links for most users. Perhaps it could be implemented in enex importer as an option - those users who think they have numerous notes falling into imperfection #2 described above could turn off this option.
Since the implementation as described here would only recreate note links where referring and target notes are in the same enex file, and given that people are often migrating from EN to Joplin using multiple enex files (e.g., 1 enex file per notebook), perhaps this note link recreation would be better implemented as a function, either in Joplin or a plugin, that user can run when desired - for example, after they have completely finished importing all enex files from EN to Joplin.
As an aside, this feature would make Joplin superior at importing enex files than Evernote itself, since Evernote import of enex files causes user to lose all note links, and EN has no provision to automatically recreate these links after the import.