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

optimize representation of empty lines in <li> and <blockquote> content #170

Open
chrispy-snps opened this issue Dec 30, 2024 · 0 comments · May be fixed by #171
Open

optimize representation of empty lines in <li> and <blockquote> content #170

chrispy-snps opened this issue Dec 30, 2024 · 0 comments · May be fixed by #171

Comments

@chrispy-snps
Copy link
Collaborator

In <li>, empty lines still get indenting spaces (spaces replaced with · in output):

from markdownify import markdownify as md

html = """
<ul>
  <li>
    <p>1</p>
    <p>2</p>
  </li>
</ul>
"""
print(md(html))
# *·1
# ·· <-- HERE
# ··2

Similarly in <blockquote> empty lines get trailing marker spaces:

from markdownify import markdownify as md

html = """
<blockquote>
  <p>1</p>
  <p>2</p>
</blockquote>
"""
print(md(html))
# >·1
# >· <-- HERE
# >·2

These empty spaces are unnecessary and can be omitted for brevity.

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

Successfully merging a pull request may close this issue.

1 participant