mirror of https://github.com/Nonannet/pyladoc.git
code according to flake8 and mypy updated
This commit is contained in:
parent
2083a6ed41
commit
507d88bc38
|
@ -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
|
||||||
|
|
|
@ -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] = {}
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue