List as a definition list item

Can you get a whole list inside a definition list item ?

the html code I get is:

<blockquote>
<dl>
<dt>He adds up :</dt>
<dd><ul>
<li>The cost of raw materials to be processed;</li>
</ul>
</dd>
<dd><ul>
<li>The wages;</li>
</ul>
</dd>
<dd><ul>
<li>The consumption of the machines, their wear and tear and the interest on the money they cost him:</li>
</ul>
</dd>
<dd><ul>
<li>The selling expenses: transport. brokerage. discounts:</li>
</ul>
</dd>
<dd><ul>
<li>The general expenses: administration, rents, taxes. insurance etc.</li>
</ul>
</dd>
</dl>
</blockquote>

while the markdown code is

> He adds up :
>: 	- The cost of raw materials to be processed;
>:	- The wages;
>:	- The consumption of the machines, their wear and tear and the interest on the money they cost him:
>:	-	The selling expenses: transport. brokerage. discounts:
>:	-	The general expenses: administration, rents, taxes. insurance etc.

You only need one : for every definition list item and the list markers - for the sublist need to be indented. Maybe you would like to write:

> He adds up:
>: - The cost of raw materials to be processed;
>  - The wages;
>  - The consumption of the machines, their wear and tear and the interest on the money they cost him:
>    - The selling expenses: transport. brokerage. discounts:
>    - The general expenses: administration, rents, taxes. insurance etc.

Nope !
as you see in the html code:

<dl>
<dt>He adds up :</dt>
<dd><ul>
<li>The cost of raw materials to be processed;</li>
</ul>
</dd>
</dl>
<ul>
<li>The wages;</li>
<li>The consumption of the machines, their wear and tear and the interest on the money they cost him:</li>
<li>The selling expenses: transport. brokerage. discounts:</li>
<li>The general expenses: administration, rents, taxes. insurance etc.</li>
</ul>

the items are not counted as part of the definition list without a starting :. Hence, there’s more space between the first element and the remaining ones.

I’m not sure what you are trying to achieve. Do you want to three definition details under the first definition marker and an unordered sublist in the third? Then, you don’t need the - list markers for the first three.

I want one and only one definition, which is a list of three elements.

{word}
: {definition}

well definition should be a list itself !

Could you maybe provide a link to a sample repository?

Here: sample - Google Drive

I would like

> sdfsd:
>:    - sdfsdf
>     - sdfsdf

to produce this code:

<blockquote>
<dl>
<dt>sdfsd:</dt>
<dd><ul>
<li>sdfsdf</li>
<li>sdfsdf</li>
</ul>
</blockquote>

Is it possible, if so how ?

Yes, it’s possible. I took the liberty to use your problem as an interesting edge case for my theme. Your last post refers to version 1 of the blog entry

AHAHAHAH if you and your readers had any idea where that comes from !
And you actually pulled it off !! Many thanks. Ah, relying on indentation is SO stupid a design !

The simplicity of Markdown has its price in complex cases like yours. I stumbled upon indentation a few times, you’re not the only one. Happy to help.

Happy ? Feel free to continue then :wink:
I’m just having almost the exact opposite need: how do I get a definition list be an item of another (normal) list ?
Something close to :

* **1980** : blablabl
* **1988**:
    : blabla
    : blabla

Alright, this is still fun. I’ve update the post and you’re new problem is here

But this is not a Markdown forum, so I suggest we close this topic here. Have fun with definition lists!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.