code according to flake8 and mypy updated

This commit is contained in:
Nicolas 2025-05-19 11:45:34 +02:00 committed by Nicolas Kruse
parent 2083a6ed41
commit 507d88bc38
3 changed files with 82 additions and 82 deletions

View File

@ -385,8 +385,8 @@ class DocumentWriter():
self.block = attr_dict.get('type') == 'block'
elif not self.in_latex:
tag_text = self.get_starttag_text()
self.self_closing = tag_text.endswith('/>')
if tag_text:
self.self_closing = tag_text.endswith('/>')
self.modified_html.write(tag_text)
if tag == 'p':
self.p_tags += 1

View File

@ -1,7 +1,7 @@
import xml.etree.ElementTree as ET
import re
from re import Match
def update_svg_ids(input_svg: str, unique_id: str) -> str:
"""Add a unique ID part to all svg IDs and update references ti these IDs"""
id_mapping: dict[str, str] = {}

View File

@ -1,5 +1,6 @@
import pyladoc
def test_update_svg_ids():
test_str = r"""
<g id="figure_1">
@ -28,7 +29,6 @@ def test_update_svg_ids():
</defs>
<path id="DejaVuSans-Oblique-78" d="M 3841 3500
L 2234 1784