yarle icon indicating copy to clipboard operation
yarle copied to clipboard

Converted EN code blocks should not escape characters

Open luckman212 opened this issue 3 years ago • 6 comments

  • yarle v3.8.2 (run from npx)
  • npm 7.4.3

I am really happy to have this tool, thank you 🙏

My notes make heavy use of code blocks, and I am finding the converted notes need a lot of cleanup, because characters such as _ or [ get escaped as \_ or \[ — even though they are contained within fenced code blocks ``` in markdown.

At this point I am just deleting the code blocks after conversion, then copy/pasting them from Evernote into Obsidian using ⌘+⇧+V which avoids the escaping...

luckman212 avatar Jan 26 '21 20:01 luckman212

Have you tried setting keepMDCharactersOfENNotes to true? 😄

joaosa avatar Jan 27 '21 11:01 joaosa

Thanks @joaosa - I thought that option was meant to indicate that I wrote my EN notes in markdown format. Maybe I mis-understood that. Anyway, I did have better success with these options set like so in my config:

"monospaceIsCodeBlock": false,
"keepMDCharactersOfENNotes": true

luckman212 avatar Jan 27 '21 16:01 luckman212

Hi @luckman212 , Your settings looks fine, keepMDCharactersOfENNotes specifies that if you used MD syntax in your EN notes, then they won't be escaped (I think even within code-blocks, right? ), and setting monospaceIsCodeBlock to false will recognize the EN codeblocks, not the 'legacy' solution in EN when the codeblocks were denoted by setting their font to monospace. Is there anything else you recognized that the converter processes wrongly?

akosbalasko avatar Jan 29 '21 22:01 akosbalasko

Thanks @akosbalasko - it's doing a very good job. I need to look into the Templates more to see about customizing that. But, one thing off the top of my head: "naked" URLs are getting converted like this (example)

Evernote:

Google: https://www.google.com

After conversion with Yarle:

Google: <https://www.google.com>

So, just the extra < and > ... not sure if it can be avoided...

luckman212 avatar Jan 29 '21 23:01 luckman212

Fix for extra escaping in code blocks (with keepMDCharactersOfENNotes at default false) is in PR #281.

medmunds avatar Jul 17 '21 01:07 medmunds

Related to this issue, Evernote allows code blocks to have formatting, which can be really ugly when converted to Markdown, so it would be nice to have an option to convert code blocks to plain text.

Screen Shot 2024-01-21 at 12 53 22

bumper314 avatar Jan 21 '24 19:01 bumper314