Skip to content

Definition lists do not insert required newlines #199

Closed

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions