cs150bf / ever-notedown

Atom Editor Plugin
MIT License
140 stars 13 forks source link

Code blocks in Evernote have additional linebreaks #27

Open 7k50 opened 8 years ago

7k50 commented 8 years ago

This is a very minor detail, but it's something I've been meaning to ask.

I really enjoy the style and look of code blocks in EVND, but when exporting them to Evernote they will have extra linespacing above and below the code.

See provided screenshot. Note that it was captured before the text in the Preview pane was changed from gray to black.

screen shot 2015-11-12 at 16 11 29

I think it would be nice if the look corresponded to that in the editor if possible, as it would be beneficial for WYSIWYG formatting.

Thanks again for a great tool!

cs150bf commented 8 years ago

Again the short story is that it's something I've struggled with in the past but have given up temporarily. Various Evernote clients seem to inject some custom stylesheets when presenting the notes (which are essentially some sort of XML->HTML), and that messes with elements like <pre>, which are used for code blocks. I tried quite hard to get the basic code block working (proper line breaks at least!) but the padding is really tricky so I eventually gave up. (If you view your notes in the Evernote web client, you may notice that the padding in code blocks is a little bit different there as well.)

I guess if we use Shadow DOM we might be able to do some proper style encapsulation and such, but until I have time to get to that...