|
1 |
| -<!DOCTYPE html> |
2 |
| -<html> |
3 |
| - <head> |
4 |
| - <meta charset="utf-8" /> |
5 |
| - <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
6 |
| - <script src="/tester.js"></script> |
7 |
| - <script src="/bundles/nano.instrumented.min.js"></script> |
8 |
| - </head> |
9 |
| - <body> |
10 |
| - <div id="root"></div> |
11 |
| - |
12 |
| - <script> |
13 |
| - const { h, render, Component, withStyles } = nanoJSX |
14 |
| - const root = document.getElementById('root') |
15 |
| - </script> |
16 |
| - |
17 |
| - <script type="module"> |
18 |
| - describe('dangerouslySetInnerHTML', async () => { |
19 |
| - const App = () => h('div', { dangerouslySetInnerHTML: { __html: '<p>html</p>' } }) |
20 |
| - render(App, root, false) |
21 |
| - const div = root.lastChild |
22 |
| - Test.error(div.innerHTML === '<fragment><p>html</p></fragment>', `Should render without escaping.`) |
23 |
| - }) |
24 |
| - |
25 |
| - describe('dangerouslySetInnerHTML (modern)', async () => { |
26 |
| - const App = () => h('div', { innerHTML: { __dangerousHtml: '<p>html</p>' } }) |
27 |
| - render(App, root, false) |
28 |
| - const div = root.lastChild |
29 |
| - console.log(div.innerHTML, div.innerText) |
30 |
| - Test.error(div.innerHTML === '<fragment><p>html</p></fragment>', `Should render without escaping.`) |
31 |
| - }) |
32 |
| - |
33 |
| - describe('dangerouslySetInnerHTML (none)', async () => { |
34 |
| - const App = () => h('div', null, '<p>html</p>') |
35 |
| - render(App, root, false) |
36 |
| - const div = root.lastChild |
37 |
| - Test.error(div.innerHTML === '<p>html</p>', `HTML should be escaped.`) |
38 |
| - }) |
39 |
| - |
40 |
| - Test.start() |
41 |
| - </script> |
42 |
| - </body> |
43 |
| -</html> |
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | + <script src="/tester.js"></script> |
| 7 | + <script src="/bundles/nano.instrumented.min.js"></script> |
| 8 | + </head> |
| 9 | + <body> |
| 10 | + <div id="root"></div> |
| 11 | + |
| 12 | + <script> |
| 13 | + const { h, render, Component, withStyles } = nanoJSX |
| 14 | + const root = document.getElementById('root') |
| 15 | + </script> |
| 16 | + |
| 17 | + <script type="module"> |
| 18 | + describe('dangerouslySetInnerHTML', async () => { |
| 19 | + const App = () => h('div', { dangerouslySetInnerHTML: { __html: '<p>html</p>' } }) |
| 20 | + render(App, root, false) |
| 21 | + const div = root.lastChild |
| 22 | + Test.error(div.innerHTML === '<fragment><p>html</p></fragment>', `Should render without escaping.`) |
| 23 | + }) |
| 24 | + |
| 25 | + describe('dangerouslySetInnerHTML (modern)', async () => { |
| 26 | + const App = () => h('div', { innerHTML: { __dangerousHtml: '<p>html</p>' } }) |
| 27 | + render(App, root, false) |
| 28 | + const div = root.lastChild |
| 29 | + console.log(div.innerHTML, div.innerText) |
| 30 | + Test.error(div.innerHTML === '<fragment><p>html</p></fragment>', `Should render without escaping.`) |
| 31 | + }) |
| 32 | + |
| 33 | + describe('dangerouslySetInnerHTML (none)', async () => { |
| 34 | + const App = () => h('div', null, '<p>html</p>') |
| 35 | + render(App, root, false) |
| 36 | + const div = root.lastChild |
| 37 | + Test.error(div.innerHTML === '<p>html</p>', `HTML should be escaped.`) |
| 38 | + }) |
| 39 | + |
| 40 | + Test.start() |
| 41 | + </script> |
| 42 | + </body> |
| 43 | +</html> |
0 commit comments