create-caspian-app 1.0.16 → 1.0.17
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.
|
@@ -101,12 +101,27 @@ class TestDeferComponentRoots:
|
|
|
101
101
|
assert "<template" in out
|
|
102
102
|
assert 'pp-component="abc"' in out
|
|
103
103
|
|
|
104
|
-
def
|
|
104
|
+
def test_brace_entities_are_double_encoded_inside_deferred_templates(self):
|
|
105
|
+
html = (
|
|
106
|
+
'<body><div pp-component="abc" '
|
|
107
|
+
'title="{attr}" '
|
|
108
|
+
'class="probe {active}">'
|
|
109
|
+
'{text}'
|
|
110
|
+
'</div><p>{outside}</p></body>'
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
out = main.defer_component_roots(html)
|
|
114
|
+
|
|
115
|
+
assert 'title="&#123;attr&#125;"' in out
|
|
116
|
+
assert 'class="probe &#x7b;active&#x7d;"' in out
|
|
117
|
+
assert "&lbrace;text&rbrace;" in out
|
|
118
|
+
assert "<p>{outside}</p>" in out
|
|
119
|
+
|
|
120
|
+
def test_finalize_html_defers_and_preserves_plain_scripts(self):
|
|
105
121
|
html = (
|
|
106
122
|
"<body><div pp-component=\"abc\">"
|
|
107
123
|
"<script>console.log(1)</script></div></body>"
|
|
108
124
|
)
|
|
109
125
|
out = main.finalize_html(html)
|
|
110
|
-
|
|
111
|
-
assert 'type="text/pp"' in out
|
|
126
|
+
assert "<script>console.log(1)</script>" in out
|
|
112
127
|
assert "<template" in out
|