Skip to content
Snippets Groups Projects
Commit ab65ddfe authored by Vanessa Stehr's avatar Vanessa Stehr
Browse files

Bugfix: detect empty "per"s

parent f06eac96
No related branches found
No related tags found
No related merge requests found
Pipeline #31559 passed
File added
File added
[metadata]
name = dsiParser
version = 1.0.0
version = 1.1.0
description = Parse D-SI unit strings to LaTeX
long_description = file: README.md
......
......@@ -66,6 +66,12 @@ class dsiParser:
tree = []
warningMessages = []
tree = dsiString.split(r"\per")
for subtree in tree:
if len(subtree) == 0:
warningMessages.append(_warn(r"The dsi string contains a \per missing a numerator or denominator! "+
f"Given string: {dsiString}",
RuntimeWarning))
tree.remove(subtree)
if len(tree) > 2:
warningMessages.append(_warn(r"The dsi string contains more than one \per, does not "+
f"match specs! Given string: {dsiString}",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment