Skip to content

Commit

Permalink
Oopsy
Browse files Browse the repository at this point in the history
  • Loading branch information
askonomm committed Jan 1, 2025
1 parent a1df2d4 commit 3ce99c1
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions dompa/dompa.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,22 @@ class Dompa:
__template: str
__ir_nodes: list[IrNode]
__nodes: list[Node]
__void_names = ["!doctype", "img", "input"]
__void_names = [
"!doctype",
"area",
"base",
"br",
"col",
"embed",
"hr",
"img",
"input",
"link",
"meta",
"source",
"track",
"wbr"
]

def __init__(self, template: str) -> None:
self.__template = template
Expand All @@ -23,7 +38,7 @@ def __create_ir_nodes(self) -> None:
Parses the given template string into a flat list of `IrNode`s,
a "intermediate representation" nodes that contain the raw info
required to later on turn it into a nested tree with proper
data.
data.
"""
tag_start = None
tag_end = None
Expand Down Expand Up @@ -175,7 +190,7 @@ def __ir_node_to_node(self, ir_node: IrNode) -> Node:
value=self.__template[ir_node.coords[0] : ir_node.coords[1]],
)

if ir_node.name in self.__void_names:
if ir_node.name.lower() in self.__void_names:
return VoidNode(
name=ir_node.name,
attributes=self.__node_attributes_from_coords(ir_node.coords),
Expand Down

0 comments on commit 3ce99c1

Please sign in to comment.