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

Loose task list items render with unintended line break #140

Open
2 tasks
nidico opened this issue Mar 11, 2023 · 1 comment
Open
2 tasks

Loose task list items render with unintended line break #140

nidico opened this issue Mar 11, 2023 · 1 comment

Comments

@nidico
Copy link

nidico commented Mar 11, 2023

The following markdown input

- [ ] foo

- bar

- [ ] baz

is rendered with line breaks (by defaultHtmlRenderer), as can be seen in the following image:

elm-markdown-issue-loose-task-items

In Github / Gitea, this would be rendered as:

  • foo

  • bar

  • baz

This is due to list items with Loose ListSpacing being wrapped in a paragraph.

Possible solutions:

  • Put the <input type="checkbox"> inside the <p> (this is what Github does, and seems to be the obvious solution to me)
  • Add position: absolute and other styling foo to <input> (this is what Gitea does)
@dillonkearns
Copy link
Owner

Seems like your idea of wrapping in the <p> tags is the standard for most parsers as well:

https://babelmark.github.io/?text=-+%5B+%5D+foo%0A%0A-+bar%0A%0A-+%5B+%5D+baz

I don't have bandwidth to take this on, but I would be glad to review a PR for this if anybody would like to tackle this issue.

Thanks for reporting this!

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

No branches or pull requests

2 participants