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

Lists and nested lists are not roundtripable #529

Open
buuhuu opened this issue Aug 21, 2024 · 3 comments · Fixed by #530 · May be fixed by #556
Open

Lists and nested lists are not roundtripable #529

buuhuu opened this issue Aug 21, 2024 · 3 comments · Fixed by #530 · May be fixed by #556
Labels
bug Something isn't working

Comments

@buuhuu
Copy link
Collaborator

buuhuu commented Aug 21, 2024

When nesting lists the text of a list is wrapped in an additional <p>.

See the test case in https://github.com/adobe/helix-html2md/compare/nested-lists-roundtrip

Examples:

<li><a href="#" title="Navigate to Text 1">Text 1</a></li>

becomes

<li>
  <p><a href="#" title="Navigate to Text 1">Text 1</a></p>
</li>
@buuhuu buuhuu added the bug Something isn't working label Aug 21, 2024
@buuhuu buuhuu changed the title Nested lists are not roundtripable Lists and nested lists are not roundtripable Aug 21, 2024
@tripodsan
Copy link
Contributor

and when you input <li><p>...</p></li> ?

@buuhuu
Copy link
Collaborator Author

buuhuu commented Aug 21, 2024

That works, yes. If we do this, we have different representation than content coming from doc-based authoring.

(We took the html from https://main--kuckstdu--msagolj.hlx.page/TipsAndTricks/unbenanntes-dokument as input)

It seems that the spread out of lists containing block elements is intentional and I would agree to some extend. However, I think it is more important to produce the same markdown a doc-based project would use.

@buuhuu
Copy link
Collaborator Author

buuhuu commented Sep 23, 2024

reverted with #539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants