Don't break the refs
Some checks failed
Run tests / test (3.10) (push) Has been cancelled
Run tests / test (3.11) (push) Has been cancelled
Run tests / test (3.12) (push) Has been cancelled
Run tests / test (3.7) (push) Has been cancelled
Run tests / test (3.8) (push) Has been cancelled
Run tests / test (3.9) (push) Has been cancelled

This commit is contained in:
Ngô Ngọc Đức Huy 2024-08-17 00:47:03 +07:00
parent 718eb615ef
commit 6bd7a5203a
Signed by: xarvos
GPG key ID: 904AF1C7CDF695C3
2 changed files with 3 additions and 0 deletions

View file

@ -371,6 +371,8 @@ def print_html(text, width=get_term_width(), padding=0):
padding -= 1
print_out("" * padding + "" + "" * (width - 1))
is_in_pre = False
elif line == '<refs>':
is_in_pre = True
elif is_in_pre:
print_out("" * padding + line)
else:

View file

@ -184,6 +184,7 @@ def html_to_paragraphs(html):
images = parser.image_links
if len(images) or len(links):
paragraphs.append('')
paragraphs.append('<refs>')
for i, link in enumerate(links):
paragraphs.append(f'[{i + 1}]: {link}')
for i, link in enumerate(images):