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

List items are not indented correctly #60

Closed
finn-matti opened this issue Oct 10, 2020 · 4 comments · Fixed by #61
Closed

List items are not indented correctly #60

finn-matti opened this issue Oct 10, 2020 · 4 comments · Fixed by #61

Comments

@finn-matti
Copy link

Given a note that looks like this in Evernote:

Screen Shot 2020-10-10 at 19 57 41

Note export looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd">
<en-export export-date="20201010T165755Z" application="Evernote Legacy" version="Evernote Mac 7.14.1 (458325)">
    <note>
        <title>ListTest</title>
        <content><![CDATA[<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><ul><li><div>Level1</div></li><ul><li><div>Level2</div></li><ul><li><div>Level3</div></li></ul></ul></ul><div><br /></div></en-note>]]></content>
        <created>20201010T165715Z</created>
        <updated>20201010T165734Z</updated>
        <note-attributes>
            <latitude>60.5566790535642</latitude>
            <longitude>24.98012759429327</longitude>
            <altitude>67.66667938232422</altitude>
            <author>Martin Hähnel</author>
            <source>desktop.mac</source>
            <reminder-order>0</reminder-order>
        </note-attributes>
    </note>
</en-export>

The note itself here as a more nicely rendered version:

<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note
  ><ul>
    <li><div>Level1</div></li>
    <ul>
      <li><div>Level2</div></li>
      <ul>
        <li><div>Level3</div></li>
      </ul>
    </ul>
  </ul>
  <div><br /></div
></en-note>

After running a command like this:

npm run start -- --enexSource=./ListNote.enex --outputDir=./out/ --includeMetadata

We get a markdown file that looks like this:

# ListTest
*   Level1
    

*   Level2
    

*   Level3

What it should have been instead:

# ListTest
*   Level1
    *   Level2
        *   Level3
@finn-matti
Copy link
Author

See also laurent22/joplin-turndown#14. The problem is that the ENML here is not valid HTML and is therefore not converted correctly. But we are dealing with ENML not HTML.

@akosbalasko
Copy link
Owner

akosbalasko commented Oct 10, 2020

Hi @finn-matti ! Yes, I think you're right, as Yarle promises to convert ENML to MD, then it has to do it, even if Evernote breaks an HTML-rule during generating ENML files. Thank you for raising this up, and I see that you raised it in joplin-turndown's and turndown's board as well, cool. I investigate how I could fix this, probably by adding and extra rule to turndown.

@finn-matti
Copy link
Author

finn-matti commented Oct 10, 2020

@akosbalasko I'm working on a PR right now. So please don't work too hard/quickly. 😄

@akosbalasko
Copy link
Owner

:D Wow! Thanks a lot @finn-matti !

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

Successfully merging a pull request may close this issue.

2 participants