nvbn / everpad

Evernote client well integrated with linux desktop
1.17k stars 143 forks source link

Everpad is breaking lists and sublists markup #428

Open franck-grenier opened 10 years ago

franck-grenier commented 10 years ago

Hello, Everpad breaks lists and sublists markup when it sends to Evernotes.

On the other side, when Everpad receives this kind of markup from Evernotes, it's OK in Everpad.

Looks like Everpad does not write lists and sublists as Evernotes expects it to.

I run Everpad on Ubuntu 12.04.

3ruce commented 10 years ago

Same problem here - Xubuntu 14.04

wimpunk commented 9 years ago

Bad to see this issue is still open. I have the same problem and it took me a while to find out where exactly it goes wrong.

wimpunk commented 9 years ago

I've done some test with a little python script which didn't do much more than this:

#!/usr/bin/python
from evernote.api.client import EvernoteClient
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec
from evernote.edam.type.ttypes import NoteSortOrder
from BeautifulSoup import BeautifulStoneSoup

auth_token = 'my-token-on-sandbox'
client = EvernoteClient(token=auth_token)
userStore = client.get_user_store()
user = userStore.getUser()
print user.username

note_store = client.get_note_store()

updated_filter = NoteFilter(order=NoteSortOrder.UPDATED)
offset = 0
max_notes = 10
result_spec = NotesMetadataResultSpec(includeTitle=True)
result_list = note_store.findNotesMetadata(auth_token, updated_filter, offset, max_notes, result_spec)

# note is an instance of NoteMetadata
# result_list is an instance of NotesMetadataList
for note in result_list.notes:
    print note.title
    print note

content = note_store.getNoteContent(auth_token, "ddad0df1-1831-4179-a14d-0803fd9b3dfd")
print content
soup = BeautifulStoneSoup(content)
print(soup.prettify())

The contents looked like

And that was the result when showing the content but when the contents got handled by BeautifulStoneSoup, there was a closing tag for <li> and <ul> after the two. The returned result looked like

 <ul>
  <li>
   one
  </li>
  <li>
   two
  </li>
 </ul>
 <ul>
  <li>
   two.one
  </li>
  <li>
   two.two
  </li>
  <li>
   two.three
  </li>
 </ul>
 <li>
  three
 </li>
 <li>
  four
 </li>

It looks like this is a BeautifulStoneSoup issue but I currently haven't find a way to fix it.