Skip to content
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

Newline (carriage return) formatting not reflected in Evernote #67

Closed
tgig opened this issue Jan 14, 2015 · 11 comments
Closed

Newline (carriage return) formatting not reflected in Evernote #67

tgig opened this issue Jan 14, 2015 · 11 comments

Comments

@tgig
Copy link

tgig commented Jan 14, 2015

It seems that my newline formatting inside of Sublime Text is not getting uploaded to Evernote. I.e., newline space between paragraphs is removed.

This is what a note looks like in the text editor, with 2-3 carriage returns between each line:

00000837

When I create the note, it appears in my Evernote App for Mac as expected, but the space between the lines is gone. Looks like this:

00000838

Is this a bug, or a settings issue?

Thanks for the ST plugin! This is such a cool one, and I appreciate the time you've spent to make it so good :)

@bordaigorl
Copy link
Owner

@tgig The conversion from plain text to rich text (HTML) is done by interpreting your plain text as Markdown. See the wiki for more details on how this is done and how to customise it.
Markdown does not translate new lines to new lines and that's why you see no extra new line in your note.

@tgig
Copy link
Author

tgig commented Jan 14, 2015

Thanks for the quick reply. Markdown is supposed to interpret 2 new lines as a paragraph tag. For example, here is a reply in github:

2015-01-14_0750

Here is the preview (with proper paragraphs, no matter how many carriage returns between the lines):

2015-01-14_0750-b

And here is the html code generated by the markdown (proper <p> tags)

2015-01-14_0751-3

So, perhaps the markdown-to-html engine you're currently using is just not correctly interpreting the new lines into <p> paragraph tags?

Also, and not sure if this is completely related, when I import an existing Evernote into sublime text, I have 5 lines between paragraphs and 8 lines between 3 EN carriage returns. Looks like this:

2015-01-14_0757

@bordaigorl
Copy link
Owner

To help me understand what's going on, could you please turn on the debug setting in your Evernote.sublime-settings file? This way you can see the converted/parsed HTML in the console...

@tgig
Copy link
Author

tgig commented Jan 14, 2015

The generated html actually looks pretty good. The <p> tags are getting generated just as I'd expect.

Here is a screen cap of a new note in ST:

2015-01-14_0938

Here is a the code generated in the console:

>>> 
Evernote: Using cached notebooks list
Evernote: Using cached notebooks list
Evernote: <p>This is the third test in ST for evernote import.</p>

<p>This is a new paragraph, 2 carriage returns below the first line.</p>

<p>This is 3 returns below the line above.</p>

<p>This is 2 returns below.
This is just one return below.</p>

<p>This is a new paragraph, 2 returns below.</p>

Evernote: []
Evernote: Using cached notebooks list
Evernote: Test ST Note 3
Evernote: []
Evernote: 6ac96315-6c41-4a8e-8cbe-ceeac245b317
Evernote: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note>
<!-- Sublime:LS0tCnRpdGxlOiBUZXN0IFNUIE5vdGUgMwpub3RlYm9vazogdGdpZydzIG5vdGVib29rCnRhZ3M6Ci0tLQoKVGhpcyBpcyB0aGUgdGhpcmQgdGVzdCBpbiBTVCBmb3IgZXZlcm5vdGUgaW1wb3J0LgoKVGhpcyBpcyBhIG5ldyBwYXJhZ3JhcGgsIDIgY2FycmlhZ2UgcmV0dXJucyBiZWxvdyB0aGUgZmlyc3QgbGluZS4KCgpUaGlzIGlzIDMgcmV0dXJucyBiZWxvdyB0aGUgbGluZSBhYm92ZS4KClRoaXMgaXMgMiByZXR1cm5zIGJlbG93LgpUaGlzIGlzIGp1c3Qgb25lIHJldHVybiBiZWxvdy4KClRoaXMgaXMgYSBuZXcgcGFyYWdyYXBoLCAyIHJldHVybnMgYmVsb3cuCgoKCgo=-->
<p>This is the third test in ST for evernote import.</p>

<p>This is a new paragraph, 2 carriage returns below the first line.</p>

<p>This is 3 returns below the line above.</p>

<p>This is 2 returns below.
This is just one return below.</p>

<p>This is a new paragraph, 2 returns below.</p>
</en-note>

Here is a screen cap of the poorly formatted note in Evernote:

2015-01-14_0939-2

This makes it apparent that the new Evernote App for Mac is not formatting <p> tags properly...


And in reverse:

Here is a note created in Evernote:

2015-01-14_0942

Here is what it looks like when imported into Sublime Text (lots of extra space):

2015-01-14_0944

And here is what is generated in the console (looks like the extra space is caused by wrapping <br>'s in <div>'s):

Evernote: <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note>
<div>This is a test note created in evernote.</div>
<div><br/></div>
<div>This is a new paragraph, 2 carriage returns below the above line.</div>
<div><br/></div>
<div><br/></div>
<div>This is a line that is 3 carriage returns below the above.</div>
<div><br/></div>
<div>This is 2 lines below.</div>
<div>This is 1 line below.</div>
<div><br/></div>
<div><br/></div>
</en-note>

Evernote: 1f9c78a7-cc8c-41b6-9694-8564e23b76b4
Evernote: Conversion ok

@bordaigorl
Copy link
Owner

Thanks a lot for the feedback.
So it would seem that these are discrepancies caused by how the client displays and converts content.
Making this look better would need ad hoc, per-client adjustments in the parsers of the plugin, something that I am not that incline in doing (it is very fragile, hard to maintain and I do not have access to all the clients).
Any suggestions on possible workarounds?

@tgig
Copy link
Author

tgig commented Jan 14, 2015

Hmmm... on the surface of things, it seems that Evernote handles <br> tags well, but not <p> tags.

I don't know how much (if any) flexibility you have with the markdown-to-html engine, but what would happen if each \n was a <br> in the generated code? (Instead of using the standard <p> tag)

Similarly, when pulling a note down, it seems that the combo of <div> and <br> causes extra spaces in the text editor - maybe the <div>'s could be eliminated, creating a standard language that all clients understand.

@tgig
Copy link
Author

tgig commented Jan 16, 2015

This is definitely not a problem with the plugin. It's a display issue in the new Evernote for Mac app. Thanks for exploring it with me - I've submitted a ticket and a forum post to the folks at Evernote. Hopefully they get it fixed up on their end...

@eizKjfRsZaGPkcNCbcAZ
Copy link

Hi tgig I was wondering if there had been any updates on the Evernote's end yet. I am getting the same problem one year after it was first brought up in this issue.

@tgig
Copy link
Author

tgig commented Jan 5, 2016

Hi @Agboh - I never heard back from them that it was fixed... but they did fix it. When I look back on the same note that was causing problems before, it now displays correctly inside of Evernote. I am using Evernote for Mac 6.3.

@eizKjfRsZaGPkcNCbcAZ
Copy link

Thank you for the quick reply. I am also using Evernote for Mac 6.3 but it still produces the extra space you mentioned above when notes are imported into Sublime Text.

screen shot 2016-01-06 at 9 19 27 am

screen shot 2016-01-06 at 9 20 05 am

Just wondering if it is possible to convert \n into <br> instead of <p>, which would make the formatting much easier in this case.

@bgwwg
Copy link

bgwwg commented Apr 19, 2016

I would suggest Sublime-evernote write <div> instead of <p> since Evernote never respects the <p> tag. Evernote replaces <p> with <div> if the paragraph is edited.

version: Mac Evernote 6.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants