-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Feature Request: Add template blocks for GUID and Note Link #487
Comments
Yihaa, thank you for reporting me this issue and to let me improve Yarle! |
Hi @bumper314 , It's a cool one, I hope I can find time to implement it soon, probably around the beginning of the next week. |
I just wanted to follow up on this one, as it's critical for my own migration from Evernote, which grows increasingly dire as Evernote started logging people out of Legacy clients this week. Do you have a bug bounty system so I can throw some bucks at getting this implemented? Thanks. |
hi @bumper314 , |
@bumper314 has funded $50.00 to this issue.
|
Hi @bumper314 , I mean currently I have this plain-text: Is this your desired format? |
evernote:// links work fine when using the external link format
Looks good to me! |
Hi @bumper314 , I think it's ready, I released it in version 6.5.0: https://github.com/akosbalasko/yarle/releases/tag/v6.5.0 Pls verify that it works for you, or If you face with some issues, bugs or anything, of course, feel free to contact me, and I'll fix it asap. |
@akosbalasko Thanks so much! There is an issue with the evernotelink replacement. I see in many of my notes that the Evernote Note Link URL (which I'm using in the YAML properties header as part of the template) is become malformed like Here's my template and config: https://gist.github.com/bumper314/9bafa3cefbf514cfa735e88b9b6ecac8 |
@bumper314 , So, ito check that this replacemenet is produced by Yarle,could you pls close Obsidian, run the conversion and check the produced file via a plain text editor? |
@akosbalasko I'm working to find a reproducible test case for you. It happens every time with my whole Evernote export (11k notes), but I can't seem to get it to happen with a smaller subset of notes. I setup a development environment so I can dig into the issue more. BTW, I was seeing munged links exactly like this even when I first tried YARLE 5.2 back in July, so I don't think the issue is related to your recent changes.
That wouldn't appear to be true, because isn't the {evernotelink} template replacement being constructed by YARLE from the Table of Contents? I've inspected the Table of Contents notes in my .enex export, and the links all look valid.
I'm seeing the munged links from a fresh export, before opening the vault in Obsidian. |
Aham, alright. Feel free to send me the whole enex if you don't mind and you don't have sensitive data in it, and I can dig into there (too). |
@bumper314 , |
@bumper314 Which Evernote version do you use? Maybe it is related. |
The interesting point is that an Evernote link should look like this:
But the generated one is this:
So the question is: how the send "evernote" (and the underscores) was added? And the slash is missing between view and the id. |
In the worst and fully dirty way I can improve the code to replace
by this:
but it is a workaround. |
Evernote 7.14 (458244 Direct) on Mac, but I was also seeing this issue with exports from 6.8 and 7.2.3 with YARLE 5.2. For a valid link URL to be munged from |
Yeah, that would be a good clue, if it would happen on 100% of the links including mines with your config. aand it doesn't answer the question of how the second "evernote" string appear there. Could you pls confirm that if you open the enex file with a text-editor you don't get any results to "evernote:///evernote____view" ? |
Dummy question: does the link's label contain inline base64 encoded images? |
Confirmed.
Nope. Ok, I have a reproducible test case and mostly understand the problem, though I'm not sure of the exact fix yet. I added a bunch of debug output to apply-links.ts around the RegExp calls and found where the issue is happening: Log output:
Key in allLinks map:
So I found in the "Script better Evernote link preview in iClip" note, that a code block contained the code Fix Suggestion: The RegEx in apply-links.ts should be more tightly constrained, perhaps look for the entire link markup including the |
wow, Evernote surprises me all the time. But in this case if I see well, as the real content was |
I don't think there's much you can do about this particular bad link, but I still think my fix suggestion above will help avoid the issue and other potential bugs related to link replacement. |
Or, you might consider doing the link replacement stuff on the HTML DOM prior to converting to Markdown. That would be much more reliable compared to RegEx. |
@bumper314
So I think the issue in general is that Yarle sanitizes the Evernote links' title without question, but it may happen that the title itself is a link. And as it is a not existing file, the question now is how we should name the internal links found dead because of Evernote's failure, and how we should label them? |
In Evernote, I was pasting some AppleScript into a code block. That code happened to have a line I'm currently testing a fix by changing isEvernoteLink to better validate internal links. I'll let you know how it goes. |
…balasko#487) A more robust check in isEvernoteLink protects against invalid links getting into the link map, causing erronious text replacements in apply-links.ts. Previously, all links starting with "https://www.evernote.com" were incorrectly assumed to be note links, now those links are better identified by an expected note link format, while other evernote.com links will be correctly treated as regular web links.
Ok, I have tested my fix and it seems pretty sound: Before I submit a PR, I would like to fix a small bug related to #498. Should I combine those, or submit two separate PRs? |
Hi @bumper314 , |
Story: #487 #584 A more robust check in isEvernoteLink protects against invalid links getting into the link map, causing erronious text replacements in apply-links.ts. Previously, all links starting with "https://www.evernote.com" were incorrectly assumed to be note links, now those links are better identified by an expected note link format, while other evernote.com links will be correctly treated as regular web links.
* fix: Invalid note links breaking other links during replacement Story: #487 #584 A more robust check in isEvernoteLink protects against invalid links getting into the link map, causing erronious text replacements in apply-links.ts. Previously, all links starting with "https://www.evernote.com" were incorrectly assumed to be note links, now those links are better identified by an expected note link format, while other evernote.com links will be correctly treated as regular web links. * tests fixed --------- Co-authored-by: bumper314 <[email protected]>
Hi @bumper314 , |
@akosbalasko has rewarded $45.00 to @akosbalasko. See it on IssueHunt
|
Each Evernote has a GUID (e.g. 9b3692d0-af0b-4bc9-a57f-02f49b3692d0) which is also used to construct the internal Note Link (e.g. evernote:///view/810537294/s331/9b3692d0-af0b-4bc9-a57f-02f49b3692d0/9b3692d0-af0b-4bc9-a57f-02f49b3692d0/). I would like access to both of these values as Template blocks.
I know this is tricky because the GUID is not stored in the ENEX (which is really stupid), but YARLE already does the work of figuring out these Note Links so it can fix/update internal links. Deriving the GUID from the Note Link is trivial.
Justifications
I'm migrating to Obsidian, but will likely need to refer back to the source Evernote notes often. Having the Note Link in the template will allow me to open the original Evernote note quickly, without needing the extraneous HTML file.
I want to put the note GUID in the YAML metadata for each note so I can open notes directly via the Obsidian Advanced URI plugin. This will eventually allow me to redirect evernote:/// URLs to obsidian:// URLs without having to fix the thousands of links I have outside of Evernote (e.g. Hookmarks)
IssueHunt Summary
akosbalasko has been rewarded.
Backers (Total: $50.00)
Submitted pull Requests
Tips
The text was updated successfully, but these errors were encountered: