Better function name

This commit is contained in:
Ivan Habunek 2023-11-04 07:38:47 +01:00
parent a9ef96c31b
commit d91c73520e
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ import textwrap
from functools import lru_cache
from toot import settings
from toot.entities import Instance, Notification, Poll, Status
from toot.utils import get_text, parse_html
from toot.utils import get_text, html_to_paragraphs
from toot.wcstring import wc_wrap
from typing import List
from wcwidth import wcswidth
@ -321,7 +321,7 @@ def print_status(status: Status, width: int = 80):
def print_html(text, width=80):
first = True
for paragraph in parse_html(text):
for paragraph in html_to_paragraphs(text):
if not first:
print_out("")
for line in paragraph:

View File

@ -36,7 +36,7 @@ def get_text(html):
return unicodedata.normalize('NFKC', text)
def parse_html(html):
def html_to_paragraphs(html):
"""Attempt to convert html to plain text while keeping line breaks.
Returns a list of paragraphs, each being a list of lines.
"""
@ -55,7 +55,7 @@ def format_content(content):
Returns a generator yielding lines of content.
"""
paragraphs = parse_html(content)
paragraphs = html_to_paragraphs(content)
first = True