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

fix: indent sublists correctly #61

Merged
merged 1 commit into from
Oct 11, 2020
Merged

fix: indent sublists correctly #61

merged 1 commit into from
Oct 11, 2020

Conversation

finn-matti
Copy link

@finn-matti finn-matti commented Oct 10, 2020

Fixes #60. This basically uses this fix but instead of doing it inside of turndown, we create DOM representation of the note already in yarle itself so we can use the function. Since we actually need to move nodes around, I don't see a way to use a rule for this.

I also added a test.

@finn-matti
Copy link
Author

Sadly I can already tell, that this is not enough. It works for the provided test case but I found a note of mine, that for some reason has a different but related problem with indented lists. I'll attach it here:

buffer.enex.zip

Here the sublist portion looks like this:

<ul>
  <li>
    <div>Zurück:</div>
  </li>
  <li style="list-style: none">
    <ul>
      <li>
        <div>s</div>
      </li>
    </ul>
  </li>
  <li>
    <div>Weiter:</div>
  </li>
  <li style="list-style: none">
    <ul>
      <li>
        <div>s</div>
      </li>
    </ul>
  </li>
  <li>
    <div>Querverweise:</div>
  </li>
  <li style="list-style: none">
    <ul>
      <li>
        <div>s</div>
      </li>
    </ul>
  </li>
</ul>

This might be related to it being created/changed/looked at on the iOS app, but this seems like valid html, where ul are contained within li. Still the rendering as Markdown is not right.

@finn-matti
Copy link
Author

Alright. Now valid HTML and valid ENML get parsed as they should!

@akosbalasko
Copy link
Owner

Wow man, it's cool! Thanks for raising this up, validation, resolving, packing etc etc, all in. Thank you very much your contribution, I really appreciate it!

@akosbalasko akosbalasko merged commit 9576010 into akosbalasko:master Oct 11, 2020
@finn-matti finn-matti deleted the fix-sublist branch November 1, 2020 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List items are not indented correctly
2 participants