I need to be able to generate the following structure:
<p>
Some text in the paragraph
<ul>
<li>item<li>
<li>item<li>
</ul>
Some more text
</p>
How can I do this using kramdown? Is it possible? I'm willing to use a reasonable amount of raw HTML if necessary, but nothing that duplicates kramdown functionality.
HTML doesn't allow lists to be inside paragraphs (for digestible explanations of this, see here and here).
I would guess that the reason you want to do this is because you want the list to inherit the CSS characteristics of the
p
element. The easiest way to do this in kramdown is exactly what you'd do in the raw HTML - encase the paragraph and the list in another element, and then style that. For example, one way of doing this would be to use this:and then include
in your
general.css
, where those properties mimic those parts of thep
element that you want.Depending on what you have in your list items and what's in the subsequent paragraph, you may need to add kramdown's end-of-block marker (a caret,
^
) after the list to get the results you want. See these parts of the kramdown documentation for more.