feat: Add support for HTML fragments (#845)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Juro Oravec 2024-12-19 10:03:35 +01:00 committed by GitHub
parent 6681fc0085
commit 4dab940db8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 1225 additions and 246 deletions

View file

@ -49,7 +49,7 @@ class InlineComponentTest(BaseTestCase):
rendered,
)
self.assertInHTML(
"<script>eval(Components.unescapeJs(`console.log(&#x27;HTML and JS only&#x27;);`))</script>",
"<script>console.log('HTML and JS only');</script>",
rendered,
)
@ -106,7 +106,7 @@ class ComponentMediaTests(BaseTestCase):
self.assertEqual(rendered.count("<style"), 0)
self.assertEqual(rendered.count("<link"), 0)
self.assertEqual(rendered.count("<script"), 2) # 2 Boilerplate scripts
self.assertEqual(rendered.count("<script"), 1) # 1 Boilerplate script
def test_css_js_as_lists(self):
class SimpleComponent(Component):