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

Rendered markdown lists contain paragraphs 🤔 #414

Open
Valexr opened this issue Nov 22, 2024 · 4 comments
Open

Rendered markdown lists contain paragraphs 🤔 #414

Valexr opened this issue Nov 22, 2024 · 4 comments
Labels
bug nuemark Related to nuemark package

Comments

@Valexr
Copy link

Valexr commented Nov 22, 2024

Screenshot 2024-11-22 at 14 11 41

It's right behavior?

@Valexr Valexr added the bug label Nov 22, 2024
@nobkd
Copy link
Collaborator

nobkd commented Nov 22, 2024

I agree, at least in cmark there's no p in lists.
Also shortly mentioned in an edit here: #379 (comment)

@nobkd nobkd added the nuemark Related to nuemark package label Nov 22, 2024
@viktor-yakubiv
Copy link

According to the observed CommonMark behaviour the following markup will not render paragraphs:

- item 1
- item 2
- item 3

while the following markup will:

- paragraph 1

- paragraph 2

- paragraph 3

This is an appropriate and logical behaviour. In the second case, you can have multiple paragraphs within a list separated by a blank line or a nested list.

@nobkd
Copy link
Collaborator

nobkd commented Nov 27, 2024

Ooooh, thank you so much @viktor-yakubiv I didn't know CommonMark behaved differently in that case.

(But nuemark creates paragraphs in both cases. I don't know if it's better if it does it in both cases or not, but at least you can style all lists the same...)

@viktor-yakubiv
Copy link

at least you can style all lists the same...

It is not true. Let me provide a simple HTML+CSS example to that proves it:

<style>
li { margin-block: 0.75rem }
p { margin-block: 1rem }
</style>

<ol>
  <li>A list
  <li>with short text items
  <li>and therefore
  <li>condensed spacing
</ol>

<ol>
  <li>
    <p>A list with long items,</p>
    <ul>
      <li>sublists,
    </ul>
    <p>multiple paragraphs,</p>
  <li><p>and therefore extended spacing.</p>
</ol>

Note a few things:

  • short lists with condensed spacing would be easily perceived as a single piece of information
  • longer lists with multiple paragraphs or sublists require this complex structure to break down the information and increase spacing.

This is what Markdown (CommonMark) does by common sense and by specification. If you care about UX (DX in this case), I would like to paraphrase the Jakob's Law:

Users write other Markdown much more than Nue's Markdown. This means that users would prefer Nuemark work in the same way as CommonMark.

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

No branches or pull requests

3 participants