python-fragments 0.26__py3-none-any.whl → 0.27__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fragments/ast_nodes.py +5 -3
- fragments/html/elements.py +1 -1
- {python_fragments-0.26.dist-info → python_fragments-0.27.dist-info}/METADATA +1 -1
- {python_fragments-0.26.dist-info → python_fragments-0.27.dist-info}/RECORD +7 -7
- {python_fragments-0.26.dist-info → python_fragments-0.27.dist-info}/WHEEL +0 -0
- {python_fragments-0.26.dist-info → python_fragments-0.27.dist-info}/entry_points.txt +0 -0
- {python_fragments-0.26.dist-info → python_fragments-0.27.dist-info}/top_level.txt +0 -0
fragments/ast_nodes.py
CHANGED
|
@@ -91,7 +91,8 @@ class ASTFragment:
|
|
|
91
91
|
for child in self.children:
|
|
92
92
|
child.transpile(transpiled_start)
|
|
93
93
|
transpiled_start = child.transpiled_end + 1
|
|
94
|
-
|
|
94
|
+
if len(self.children) > 0:
|
|
95
|
+
transpiled_start -= 1
|
|
95
96
|
|
|
96
97
|
self.transpiled_content = self.__template__.format(",".join(child.transpiled_content for child in self.children))
|
|
97
98
|
self.transpiled_end = self.transpiled_start + len(self.transpiled_content)
|
|
@@ -133,7 +134,7 @@ class ASTHTMLElement:
|
|
|
133
134
|
for child in self.children:
|
|
134
135
|
child.transpile(transpiled_start)
|
|
135
136
|
transpiled_start = child.transpiled_end + 1
|
|
136
|
-
if self.children:
|
|
137
|
+
if len(self.children) > 0:
|
|
137
138
|
transpiled_start -= 1
|
|
138
139
|
children = ",".join(child.transpiled_content for child in self.children)
|
|
139
140
|
oneline_offset = len(str(self.one_line))
|
|
@@ -406,7 +407,8 @@ class ASTHTMLComment:
|
|
|
406
407
|
|
|
407
408
|
def transpile(self, transpiled_start: int) -> None:
|
|
408
409
|
self.transpiled_start = transpiled_start
|
|
409
|
-
|
|
410
|
+
escaped_content = self.content.replace("\n", "\\n").replace("\t", "\\t").replace("\r", "\\r").replace('"', '\\"')
|
|
411
|
+
self.transpiled_content = self.__template__.format(escaped_content)
|
|
410
412
|
self.transpiled_end = self.transpiled_start + len(self.transpiled_content)
|
|
411
413
|
|
|
412
414
|
def map_offset(self, offset: int) -> None:
|
fragments/html/elements.py
CHANGED
|
@@ -18,7 +18,7 @@ def el(
|
|
|
18
18
|
name,
|
|
19
19
|
className_to_string(attributes.pop("className")) if "className" in attributes else None,
|
|
20
20
|
style_to_string(attributes.pop("style")) if "style" in attributes else None,
|
|
21
|
-
attributes_to_string(attributes) if attributes
|
|
21
|
+
attributes_to_string(attributes) if attributes else None,
|
|
22
22
|
]
|
|
23
23
|
tag_contents = [item for item in tag_contents if item is not None]
|
|
24
24
|
tag_contents_string = " ".join(tag_contents)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
fragments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
fragments/ast_nodes.py,sha256=
|
|
2
|
+
fragments/ast_nodes.py,sha256=qw0YrnrQOUaGnjfY3ZYFCF5yGMSOqhZ-MQ0vM6Mlekg,20161
|
|
3
3
|
fragments/cli.py,sha256=9P9fvurRlROstWUh-tjneFt9IrVvgxcBEd3pn0wL_CE,1292
|
|
4
4
|
fragments/grammar.py,sha256=5JzDukLFxhyxWOWUJQFzKNsfm0RTtSjF678vOLjDLW4,12887
|
|
5
5
|
fragments/loader.py,sha256=7nlsXVjCpRRmd939UJQqd9NWbE2-3ZtbO0aFfz3zCs8,980
|
|
@@ -7,7 +7,7 @@ fragments/source.py,sha256=cbDzLOlFy2C6xZe-ZWcroieGG-7PLTdLJi003aIdegg,1000
|
|
|
7
7
|
fragments/transpiler.py,sha256=O4pusCuv_Hbms2J0AP3tun-uNkXfb27RBUugr_0dIVA,316
|
|
8
8
|
fragments/types.py,sha256=tPD0YHT5rOaZMfrXWDz6W0HEQwu4EJyfVNR-pd_CX0A,152
|
|
9
9
|
fragments/html/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
fragments/html/elements.py,sha256=
|
|
10
|
+
fragments/html/elements.py,sha256=iKzCCPvZNMYLIHW5ZVYy27zQcRxLnEP-B8fND_H4hF4,1886
|
|
11
11
|
fragments/lsp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
fragments/lsp/based_proxy.py,sha256=pFH-70H7uvy8yqxmq2s3jOmHw_CrAUHzyqiQXmDpJEI,3746
|
|
13
13
|
fragments/lsp/file_state.py,sha256=mghS-hcvZyPb8n9Ufypteu9DDZfv9Ktin-3C7GYxBh0,3292
|
|
@@ -32,8 +32,8 @@ fragments/lsp/pyright_notification_handlers/__init__.py,sha256=47DEQpj8HBSa-_TIm
|
|
|
32
32
|
fragments/lsp/pyright_notification_handlers/capability.py,sha256=1xH6SttTtWKAovCfx8WeJApRI4rrVlZDGCWHtlyGTUE,868
|
|
33
33
|
fragments/lsp/pyright_notification_handlers/configuration.py,sha256=Qomq8tCVcBg15MYDPby-PeRp4kJe7k8o6-2VRAYQ0hI,1009
|
|
34
34
|
fragments/lsp/pyright_notification_handlers/diagnostics.py,sha256=n_YZ8k8PHKcpHrgmTYTU2-pKi0P_v_WC1irqtAcs_iI,1107
|
|
35
|
-
python_fragments-0.
|
|
36
|
-
python_fragments-0.
|
|
37
|
-
python_fragments-0.
|
|
38
|
-
python_fragments-0.
|
|
39
|
-
python_fragments-0.
|
|
35
|
+
python_fragments-0.27.dist-info/METADATA,sha256=UHgC137TQMUntEblIznipv4isf-PMTYyyIyMDPP5h6s,1545
|
|
36
|
+
python_fragments-0.27.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
37
|
+
python_fragments-0.27.dist-info/entry_points.txt,sha256=9xVMCpt9OucM3W3fh0UnEeErKEyI6CNIFqfQCIuGmi8,96
|
|
38
|
+
python_fragments-0.27.dist-info/top_level.txt,sha256=4r1SNnHOK3BVhAT_KgV8MRq9kiV23yK_rnuTAEl5oRg,10
|
|
39
|
+
python_fragments-0.27.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|