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

The definition item in a descrition list is always a paragraph #308

Open
dimztimz opened this issue Jul 5, 2024 · 6 comments
Open

The definition item in a descrition list is always a paragraph #308

dimztimz opened this issue Jul 5, 2024 · 6 comments

Comments

@dimztimz
Copy link

dimztimz commented Jul 5, 2024

In commonmark and in djot we can have simple ordered list or lists where every item is paragraph. For example:

1. simple
2. list
3. test

1) list elements are paragraphs

2) test
3) test 2

The empty line in the second list forces each <li> to also contain <p>.

We do not have such choice for description lists.

: term, not a paragraph

  definition, always a paragraph

Emits the following HTML:

<dl>
<dt>term, not a paragraph</dt>
<dd>
<p>definition, always a paragraph</p>
</dd>
</dl>

How can we get rid of that <p>?

@jgm
Copy link
Owner

jgm commented Jul 5, 2024

: term
  definition

: otherterm
  definition

@dimztimz
Copy link
Author

dimztimz commented Jul 5, 2024

: term
  definition

: otherterm
  definition

That does not seem to work in the online version of djot. It puts the term and the definition under <dt> while <dd> is empty.

<dl>
<dt>term
definition</dt>
<dd>
</dd>
<dt>otherterm
definition</dt>
<dd>
</dd>
</dl>

@jgm
Copy link
Owner

jgm commented Jul 5, 2024

Sorry, my mistake!

@jgm
Copy link
Owner

jgm commented Jul 5, 2024

Perhaps we need to modify (or reinterpret) the rule for tight lists for definition lists.
Currently these are being counted as "loose" lists because of the blank line after the term. But since that blank line is required, there is no way to make a tight definition list. The obvious thing would be to disregard that first blank in determining whether the list is tight.

@Omikhleia
Copy link

But was is the real problem of having a <p> for something that is a paragraph by nature? (Or it isn't? Please explain the rationale to get rid of it, and the implications.)

@Omikhleia
Copy link

(N.B. It does seem similar to #138 (comment) -- though on a purely typographic angle, i.e. notwithstanding HTML idiosyncrasies, I don't really understand the key difference between tight and loose lists, except it might have to do with paragraph leading.)

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

3 participants