Skip to content

Definition lists do not insert required newlines #199

@chrispy-snps

Description

@chrispy-snps

If the HTML input does not contain any newlines around definition list tags:

import markdownify

md = markdownify.MarkdownConverter().convert

print(md("""
text<dl><dt>Term 1</dt><dd>Definition 1</dd><dt>Term 2</dt><dd>Definition 2</dd></dl>text
""".strip()))

then the Markdown output is also missing newlines:

text
Term 1
:   Definition 1
Term 2
:   Definition 2
text

New lines are required before/after <dl> tags and before <dt> tags as described here:

https://pandoc.org/MANUAL.html#definition-lists

https://michelf.ca/projects/php-markdown/extra/#def-list

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions