Markdown formatting bug when importing from Evernote

Testing version: 2.0.17

What were you doing: importing notes from evernote enex files.

What feature did you use: import from Evernote

What happened: spaces were removed from a text string when markdown formatting was applied while importing notes from Evernote.

What did you expect to happen: text and formatting would be imported with correctly applied markdown notation

Long story short I’m leaving Evernote for Bear but am carefully testing the way notes are imported because I’m kind of picky about the formatting I use. Below is the generalized example of what I am repeatedly experiencing with a specific string of formatted text when it’s imported into Bear from an Enex file…

Original text string from Evernote: Bold & Italicized Text // Italicized Text (the two // are bold)
Expected string after bear import: ***Text* //** *text*
Actual string after import: ***Text*//***Text* (as noted, it seems like the spaces on either side of the slashes are being accidentally removed when the markdown is applied on import)

Here’s a screenshot of the example above just to make sure the problem is clear.

Thanks for taking your time to consider this bug. I’m really excited about getting started with Bear, just wanting to make sure that transition process from Evernote runs as smooth as possible.

Here’s two screen shots of the original formatted text string in Evernote and then what it looks like once it’s been imported into Bear…
Screenshot 2023-11-10 at 9.30.54 AM

Hello again,

this is an interesting case and I need to break it into 2 parts: The spacing between the words is possibly a bug in the ENEX importer and should be relatively easy to address. The second part concerns common mark and I’m more unsure. The problem originates from the / character before the right closing ** as it invalidates the marker itself.

You can see the HTML output of the same string on CMark’s dingus.

I should probably work around it when the ENEX is imported and “break” the bold/italic into something like this ***bold & italicized text*** **//** ...

yeah, that “/” character really does cause some headaches, I’ve just been using a " // " as a visual separator in my note taking in Evernote for the past decade+ and as a result it’s in almost every note I have (although not always with this formatting). Thanks for considering a workaround for this pretty niche issue, I’m really excited to make the transition to Bear and finally leave Evernote behind.

I was just following up to see if this workaround might be something that would be implemented in the near term, and so I should just wait a little bit to import my 1800ish notes from Evernote to Bear, or if the timetable on this fix/workaround would be more long term and I should just go ahead with importing my notes and figure out a way to fix the formatting later? I know everyone over at bear HQ is working hard on making this product great for everyone, and this is a pretty niche issue, just trying to figure out my next steps.

I can’t guarantee this import issue will be solved quickly because any change to the HTML (Notes are expressed as HTML inside the ENEX file) to markdown has consequences all across the app and we have to be careful.

I was able to come up with a phyton script that utilizes the following regex substitution to solve the problem if that helps you or anyone else.

re.sub(r'\s*//</([bi])>\s*', r"</\1> <\1>//</\1> "

it takes strings in the exported enex files that look like this…

<div><b><i>TEXT</i> //</b><i>TEXT</i></div>

and turns them into strings that look like this…

<div><b><i>TEXT</i></b> <b>//</b> <i>TEXT</i></div>

Hello. Yes, I came out with a similar solution but I don’t like the final string being spaced and I wish we could not mess with the original data at all. Thanks for the follow-up.

1 Like