code according to flake8 and mypy updated

This commit is contained in:
Nicolas 2025-05-19 11:45:34 +02:00
parent 1bae23fedf
commit b9e600615c
3 changed files with 82 additions and 82 deletions

View File

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

View File

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

View File

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