Skip to content

Commit

Permalink
Merge pull request #21 from TI-Toolkit/crlf
Browse files Browse the repository at this point in the history
Add `\r\n` as newline variant
  • Loading branch information
rpitasky authored Jun 30, 2024
2 parents 28ac2b8 + 52ece0d commit 07025a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions 8X.xml
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@
<lang code="en" ti-ascii="D6">
<display>&#010;</display>
<accessible>&#010;</accessible>
<variant>&#013;&#010;</variant>
</lang>
</version>
</token>
Expand Down
8 changes: 4 additions & 4 deletions scripts/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def children(regex: str):

# Require text to match regex
def text(regex: str):
if not re.fullmatch(regex, element.text):
if not re.fullmatch(regex, element.text, flags=re.DOTALL):
raise ValidationError(f"<{element.tag}> text '{element.text}' does not match r'{regex}'")

# Check requirements for each tag
Expand Down Expand Up @@ -102,13 +102,13 @@ def text(regex: str):
children(r"<name>" if for_73 else r"<display><accessible>(<variant>)*")

case "name" if for_73:
text(r"[\S\s]+")
text(r".+")

case "display":
text(r"[\S\s]+")
text(r".+")

case "accessible":
text(r"[\u0000-\u00FF]*")
text(r"[\u0000-\u00FF]+")

if element.text in all_names[version][lang]:
raise ValidationError(f"{lang} accessible name '{element.text}' is not unique within {version}")
Expand Down

0 comments on commit 07025a2

Please sign in to comment.