Skip to content

Commit 91e9b8a

Browse files
committed
Fix missing metadata and newline for TokenIDE
1 parent 7811d40 commit 91e9b8a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/tokenide.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,14 @@ def to_element(self) -> ET.Element:
9999
{"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
100100
"xmlns:xsd": "http://www.w3.org/2001/XMLSchema"})
101101

102-
sheet.extend(self.sheet["meta"])
102+
sheet.extend(self.sheet["meta"] or [ET.Element("Groups"), ET.Element("Styles")])
103103

104104
def build_page(element: ET.Element, byte: str, dct: dict):
105-
if byte:
105+
# Special case for newline
106+
if byte == "$3F":
107+
element = ET.SubElement(element, "Token", byte=byte, string=r"\n", stringTerminator="true")
108+
109+
elif byte:
106110
element = ET.SubElement(element, "Token", byte=byte,
107111
**({"string": dct["string"]} if dct.get("string", None) is not None else {}),
108112
**dct.get("attrib", {}))

0 commit comments

Comments
 (0)