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

Error msg: 'div' html tag with 'markdown' attribute #207

Open
theandychung opened this issue Aug 3, 2018 · 11 comments
Open

Error msg: 'div' html tag with 'markdown' attribute #207

theandychung opened this issue Aug 3, 2018 · 11 comments

Comments

@theandychung
Copy link

theandychung commented Aug 3, 2018

I clipped a webpage to evernote and open it in sublime text 3 using this package. I found this package is not able to update my note back to evernote if my note has more than 5 layers of div. The error msg i get is the following:

Evernote Complained:
The contents of the note are not valid.
The note contains a 'div' HTML tag with a
'markdown' attribute; this is not allowed in a note.

Retry?

Here is a sample code I made:

<div markdown="1" style="-evernote-webclip: true;">
<div markdown="1" style="font-size: 16px; display: inline-block;">
<div markdown="1" style="font-size: 16px; display: inline-block;">
<div markdown="1" style="font-size: 16px; display: inline-block;">
<div markdown="1" style="font-size: 16px; display: inline-block;">
xxxx

</div>
</div>
</div>
</div>
</div>

I noticed that the similar extension in vscode, evermonkey, doesn't add markdown="1" when pulling the notes from evernote server, and it doesn't have any problem uploading the note back to evernote. I wonder if disabling automatically adding these markdown attributes could solve this issue.

Thank you for making this wonderful package for us.

@nonbeing
Copy link

nonbeing commented Oct 1, 2018

I'm getting the same error.

And yes, editing and publishing the same note in VS Code's "evermonkey" extension works fine without any errors. This used to work fine a while ago (more than a year ago when I last used sublime-evernote, so I guess the API or something's changed since then and this extension needs to be updated.

@bordaigorl
Copy link
Owner

bordaigorl commented Oct 15, 2018

THanks for reporting this issue!
I looked into this.
The problem is twofold:

  1. the Evernote format keeps changing without documentation and inconsistently across clients.
  2. the markdown converter we use in this plugin is crap.

Fixing 2 seems trivial but is not as the conversion needs to be heavily customised to be compatible with Evernote's restrictions on the notes content.

I am going to push a patch that should help with these cases. I need your help with testing. And there's no guarantee it works in all cases and that it will work in the future.

@bordaigorl
Copy link
Owner

@theandychung @nonbeing I would be very grateful if you could install the new-codeblocks branch and test it with your workflow to see if the problems are solved.

@theandychung
Copy link
Author

theandychung commented Oct 17, 2018

I can't upgrade the package through package control, do I need to upgrade it manually?

oops, accidentally closed this lol

@bordaigorl
Copy link
Owner

bordaigorl commented Oct 17, 2018

@theandychung yes you need to do this manually (I'm not updating the master version without testing 😉 )
One way would be to replace the package in sublimetext by cloning the new-codeblocks branch in the Packages/Evernote directory.
You can put the old version back when you are done or just switch to the master branch (but then you would need to pull to update the repo instead of relying on package control).

@theandychung
Copy link
Author

theandychung commented Oct 18, 2018

It's the same. The website I'm having problem is this one.

@bordaigorl
Copy link
Owner

@theandychung could you please give some more details?
I need:

  1. which platform you are using (os, browser, evernote client)
  2. what actions you take: what do you do with the webclipper? Save selection? The whole page?
  3. what you expect to happen when you open a webclip from sublime text
  4. what you expect to happen when you edit and save a webclip from sublime text
  5. what happens instead.

Thanks

@bordaigorl
Copy link
Owner

I did some tests on the page you linked.
It turns out a different problem was kicking in: the webclipper is inlining styles, including fonts and delimiting font names with &quot;. That caused the plugin to first turn these into " upon conversion and then getting confused because of non matching " in the attributes of the divs.
I just pushed a patch in new-codeblocks, try pull and test again.

@theandychung
Copy link
Author

Sorry, I should have made it more clear. I used webclipper to clip a section of the page, then open it in the sublime text 3, then trying to update the note. The new patch didn't work for me.

@bordaigorl
Copy link
Owner

@theandychung Can you explain what went wrong?

@theandychung
Copy link
Author

The error msg I mentioned at the beginning pops out whenever I want to update the note back to evernote (even if I didn't edit anything). I wonder if this is an unexpected behavior.

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

3 participants