@ptengine/lp-editor-core 1.0.0-alpha.0 → 1.0.0-alpha.2

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.
Files changed (44) hide show
  1. package/README.md +14 -4
  2. package/dist/golden/fixtures/html/01-tailwind-landing.html +92 -0
  3. package/dist/golden/fixtures/html/02-table-foster-parenting.html +29 -0
  4. package/dist/golden/fixtures/html/03-p-block-nesting.html +20 -0
  5. package/dist/golden/fixtures/html/04-unclosed-misnested.html +29 -0
  6. package/dist/golden/fixtures/html/05-attr-quotes-entities-unicode.html +19 -0
  7. package/dist/golden/fixtures/html/06-comments-rawtext.html +46 -0
  8. package/dist/golden/fixtures/html/07-boolean-empty-attrs.html +46 -0
  9. package/dist/golden/fixtures/html/08-mega-class-list.html +11 -0
  10. package/dist/golden/fixtures/html/09-legacy-doctype.html +17 -0
  11. package/dist/golden/fixtures/html/10-foreign-template-pre.html +40 -0
  12. package/dist/golden/fixtures/html/11-adoption-agency-deep.html +28 -0
  13. package/dist/golden/fixtures/html/12-charrefs-control-chars.html +23 -0
  14. package/dist/golden/fixtures/html/13-namespaces-custom-dup-attrs.html +25 -0
  15. package/dist/golden/fixtures/page/01-etvos-article-lp.html +184 -0
  16. package/dist/golden/fixtures/page/02-vivaia-campaign-lp.html +188 -0
  17. package/dist/golden/fixtures/page/README.md +28 -0
  18. package/dist/golden/fixtures/popup/01-jp-coupon-line-tall.html +10 -0
  19. package/dist/golden/fixtures/popup/02-jp-webinar-doctor.html +17 -0
  20. package/dist/golden/fixtures/popup/03-jp-model-recruit.html +17 -0
  21. package/dist/golden/fixtures/popup/04-jp-shinpi-campaign.html +12 -0
  22. package/dist/golden/fixtures/popup/05-jp-jal-course.html +17 -0
  23. package/dist/golden/fixtures/popup/06-jp-training-two-cta.html +17 -0
  24. package/dist/golden/fixtures/popup/07-vivaia-lightweight-shoes.html +12 -0
  25. package/dist/golden/fixtures/popup/08-sticky-black-friday-countdown.html +8 -0
  26. package/dist/golden/fixtures/popup/09-sticky-line-coupon-countdown.html +6 -0
  27. package/dist/golden/fixtures/popup/10-sticky-coupon-code-countdown.html +9 -0
  28. package/dist/golden/fixtures/popup/11-sticky-anniversary-countdown.html +5 -0
  29. package/dist/golden/fixtures/popup/12-vivaia-product-grid.html +29 -0
  30. package/dist/golden/fixtures/popup/13-vivaia-restock-split.html +9 -0
  31. package/dist/golden/fixtures/popup/14-back-to-school-email-form.html +14 -0
  32. package/dist/golden/fixtures/popup/15-xtool-ebook-split-form.html +9 -0
  33. package/dist/golden/fixtures/popup/16-880-off-gradient-form.html +8 -0
  34. package/dist/golden/fixtures/popup/17-holiday-sale-price-swatch.html +18 -0
  35. package/dist/golden/fixtures/popup/18-solar-battery-dark-specs.html +14 -0
  36. package/dist/golden/fixtures/popup/19-jp-clinic-coupon-placeholder.html +8 -0
  37. package/dist/golden/fixtures/popup/README.md +31 -0
  38. package/dist/golden/manifest.json +96 -0
  39. package/dist/golden/ops-cases.json +179 -0
  40. package/dist/golden/verify.mjs +101 -0
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.js +1 -1
  43. package/dist/index.js.map +1 -1
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -73,11 +73,21 @@ if (result.ok) {
73
73
  可能改变时**递增 —— 下游按它判断已有成品要不要重新生成。改一条规则数据不应该让所有成品
74
74
  失效,所以这两个号有意分开。
75
75
 
76
- ### golden 摘要清单
76
+ ### 接上去之前先验一遍
77
77
 
78
- 包里带 `dist/golden/manifest.json`:`{ fixture, COMPILER_VERSION, sha256 }`。下游可以在 Node
79
- 侧跑一遍样例、算 sha256 与它比对,确认自己这一侧与发布时的产物一致,不需要装浏览器。
80
- 完整快照留在源码仓里,不随包发布。
78
+ ```bash
79
+ node node_modules/@ptengine/lp-editor-core/dist/golden/verify.mjs
80
+ ```
81
+
82
+ 它拿包里发的 fixture,用**你这一侧的 DOM 实现**跑一遍 parse / apply / serialize,算 sha256
83
+ 与 `dist/golden/manifest.json` 里的期望值比。全部一致才说明你的环境(jsdom 版本、Node 版本)
84
+ 产出的字节与发布时相同 —— 不一致的话,你的页面缓存会和编辑器逐轮分叉,而且不报错。
85
+
86
+ 需要 jsdom 在场(这个包自己不依赖它 —— DOM 由宿主注入)。不需要装浏览器:浏览器那一侧
87
+ 在 core 自己的 CI 里已经验过。
88
+
89
+ 包里带的是**输入**(`dist/golden/fixtures/`)与**期望哈希**(`manifest.json`);
90
+ 完整的期望输出留在源码仓里调试用,不随包发布。
81
91
 
82
92
  ## 许可
83
93
 
@@ -0,0 +1,92 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ja">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>スマート分析プラットフォーム | Ptengine</title>
7
+ <script src="https://cdn.tailwindcss.com/4.0.0"></script>
8
+ <style type="text/tailwindcss">
9
+ @theme {
10
+ --color-brand-50: oklch(0.97 0.014 254.6);
11
+ --color-brand-500: oklch(0.62 0.19 259.8);
12
+ --color-brand-900: #1e3a8a;
13
+ --font-display: "Noto Sans JP", ui-sans-serif, system-ui, sans-serif;
14
+ --spacing-gutter: 1.375rem;
15
+ --breakpoint-3xl: 120rem;
16
+ }
17
+ @layer components {
18
+ .cta-btn { @apply rounded-full px-6 py-3 font-semibold; }
19
+ }
20
+ </style>
21
+ </head>
22
+ <body class="bg-brand-50 font-display antialiased" data-pt-page="lp-2024-autumn" data-pt-variant="B">
23
+ <header class="sticky top-0 z-50 backdrop-blur" data-pt-section="header" data-pt-track-impression="true">
24
+ <nav class="mx-auto flex max-w-7xl items-center justify-between p-gutter" aria-label="グローバルナビゲーション">
25
+ <a href="/" class="-m-1.5 p-1.5" data-pt-cta="logo">
26
+ <span class="sr-only">株式会社ポップインサイト</span>
27
+ <picture>
28
+ <source srcset="/img/logo.avif 1x, /img/logo@2x.avif 2x" type="image/avif">
29
+ <source srcset="/img/logo.webp 1x, /img/logo@2x.webp 2x" type="image/webp" media="(min-width: 768px)">
30
+ <img src="/img/logo.png" alt="Ptengine ロゴ" width="148" height="32" class="h-8 w-auto" loading="eager" decoding="async">
31
+ </picture>
32
+ </a>
33
+ <button type="button" class="cta-btn bg-brand-500 text-white hover:bg-brand-900" data-pt-cta="nav-signup" data-pt-cta-position="header-right">
34
+ 無料で始める
35
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="ml-1 inline size-4" aria-hidden="true">
36
+ <path fill-rule="evenodd" d="M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z" clip-rule="evenodd"></path>
37
+ </svg>
38
+ </button>
39
+ </nav>
40
+ </header>
41
+
42
+ <main>
43
+ <section class="relative isolate overflow-hidden px-6 pt-14 lg:px-8" data-pt-section="hero" data-pt-experiment="hero-copy-v3">
44
+ <div class="mx-auto max-w-2xl py-32 sm:py-48 lg:py-56">
45
+ <h1 class="text-balance text-5xl font-semibold tracking-tight text-brand-900 sm:text-7xl">
46
+ データを、<br>すぐに&ldquo;動く&rdquo;施策へ。
47
+ </h1>
48
+ <p class="mt-8 text-pretty text-lg text-gray-600 sm:text-xl/8">
49
+ ヒートマップ・A/Bテスト・パーソナライズを1つに。エンジニア不要で、今日から改善を回せます。
50
+ </p>
51
+ <div class="mt-10 flex items-center gap-x-6">
52
+ <a href="/signup?utm_source=lp&amp;utm_medium=hero" class="cta-btn bg-brand-500 text-white shadow-sm" data-pt-cta="hero-primary">無料トライアル</a>
53
+ <a href="#features" class="text-sm/6 font-semibold text-gray-900" data-pt-cta="hero-secondary">機能を見る <span aria-hidden="true">→</span></a>
54
+ </div>
55
+ </div>
56
+ <figure class="mt-16">
57
+ <picture>
58
+ <source media="(min-width: 1024px)" srcset="/img/hero-lg.webp" type="image/webp">
59
+ <source media="(min-width: 640px)" srcset="/img/hero-md.webp" type="image/webp">
60
+ <img src="/img/hero-sm.jpg" alt="ダッシュボードのスクリーンショット" class="rounded-xl shadow-2xl ring-1 ring-gray-900/10" width="2432" height="1442">
61
+ </picture>
62
+ <figcaption class="mt-3 text-center text-sm text-gray-500">実際の管理画面(2024年10月時点)</figcaption>
63
+ </figure>
64
+ </section>
65
+
66
+ <section id="features" class="py-24" data-pt-section="features">
67
+ <dl class="mx-auto grid max-w-7xl grid-cols-1 gap-x-8 gap-y-16 px-6 sm:grid-cols-2 lg:grid-cols-3">
68
+ <div class="flex flex-col" data-pt-card="feature-1">
69
+ <dt class="text-base font-semibold text-brand-900">ヒートマップ</dt>
70
+ <dd class="mt-1 text-sm text-gray-600">クリック・スクロール・アテンションを同時に計測。</dd>
71
+ </div>
72
+ <div class="flex flex-col" data-pt-card="feature-2">
73
+ <dt class="text-base font-semibold text-brand-900">A/Bテスト</dt>
74
+ <dd class="mt-1 text-sm text-gray-600">コード変更なしで、ノーコードエディタから配信。</dd>
75
+ </div>
76
+ <div class="flex flex-col" data-pt-card="feature-3">
77
+ <dt class="text-base font-semibold text-brand-900">パーソナライズ</dt>
78
+ <dd class="mt-1 text-sm text-gray-600">セグメントごとに出し分け。効果はリアルタイムで確認。</dd>
79
+ </div>
80
+ </dl>
81
+ </section>
82
+ </main>
83
+
84
+ <footer class="border-t border-gray-200 py-12 text-center text-xs text-gray-500" data-pt-section="footer">
85
+ <p>&copy; 2024 Ptmind, Inc. All rights reserved.</p>
86
+ </footer>
87
+ <script>
88
+ window.__PT__ = { pageId: "lp-2024-autumn", variant: "B", locale: "ja-JP" };
89
+ if (1 < 2 && 3 > 2) { console.log("a & b <script> not-a-tag"); }
90
+ </script>
91
+ </body>
92
+ </html>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><title>foster parenting</title></head>
4
+ <body>
5
+ <p>before table</p>
6
+ <table class="pricing" data-pt-table="plans">
7
+ stray text directly inside table
8
+ <caption>料金プラン</caption>
9
+ <thead>
10
+ <tr><th scope="col">プラン</th><th scope="col">価格</th></tr>
11
+ </thead>
12
+ more stray text between sections
13
+ <tbody>
14
+ <tr>
15
+ leaked text inside tr
16
+ <td>Free</td>
17
+ <td>¥0</td>
18
+ </tr>
19
+ <div class="this-div-gets-fostered">a div inside tbody</div>
20
+ <tr><td>Pro</td><td>¥9,800</td></tr>
21
+ </tbody>
22
+ <b>bold directly in table</b>
23
+ </table>
24
+ <table>
25
+ <tr><td>implicit tbody</td></tr>
26
+ </table>
27
+ <p>after table</p>
28
+ </body>
29
+ </html>
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><title>p auto-close</title></head>
4
+ <body>
5
+ <p>paragraph one <div class="block-inside-p">a div inside a p</div> trailing text</p>
6
+ <p>paragraph two
7
+ <table><tr><td>table inside p</td></tr></table>
8
+ after the table
9
+ </p>
10
+ <p>nested <p>paragraph inside paragraph</p> still?</p>
11
+ <p>list inside p
12
+ <ul><li>item a</li><li>item b</ul>
13
+ </p>
14
+ <p>header inside p <h2>an h2</h2> tail</p>
15
+ <p><form action="/x"><input name="q"><p>p inside form inside p</p></form></p>
16
+ <div><p>ok paragraph</div>
17
+ <p>a <b>b <i>c</b> d</i> e</p>
18
+ <span><p>p inside span</p></span>
19
+ </body>
20
+ </html>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>unclosed and misnested</title>
5
+ <body>
6
+ <div class="outer">
7
+ <section class="never-closed">
8
+ <b>bold <i>bolditalic</b> italic only</i>
9
+ <ul>
10
+ <li>one
11
+ <li>two
12
+ <li>three
13
+ </ul>
14
+ <a href="/one">first <a href="/two">second</a> tail
15
+ <em>emphasis without close
16
+ </div>
17
+ <article>
18
+ <h3>heading not closed
19
+ <p>paragraph not closed
20
+ <blockquote>quote not closed
21
+ </article>
22
+ </span>
23
+ </div>
24
+ </td>
25
+ </tr>
26
+ <font color="red"><p>font then p</font></p>
27
+ <table><td>td without tr</td></table>
28
+ </body>
29
+ </html>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ja">
3
+ <head><meta charset="utf-8"><title>属性の引用符・実体参照・Unicode</title></head>
4
+ <body>
5
+ <div id='single-quoted' title='彼は "こんにちは" と言った' data-pt-label='He said "hi" & left'>double quotes inside a single-quoted value</div>
6
+ <div title="単一引用符 'それ' を含む" data-pt-note="a &lt; b &amp;&amp; c &gt; d">entities in attribute values</div>
7
+ <a href="/search?q=%E6%97%A5%E6%9C%AC&amp;page=2&amp;sort=desc" data-pt-cta="search-link">already-escaped ampersands</a>
8
+ <a href="/search?q=raw&page=2&lt=3&amp=4&copy=x" data-pt-cta="bare-amp">bare ampersands that are not entities</a>
9
+ <span data-unquoted=noquotes-here class=bare-class>unquoted attribute values</span>
10
+ <p data-pt-emoji="🎌🇯🇵👨‍👩‍👧‍👦" data-pt-cjk="日本語・中文・한국어" data-pt-math="∑∫√≠≤≥" data-pt-nbsp="a&nbsp;b" data-pt-zwj="a&zwj;b">Unicode in attributes</p>
11
+ <p>Text entities: &amp; &lt; &gt; &quot; &apos; &copy; &nbsp; &mdash; &hellip; &#x1F389; &#12354; &notit; &notin;</p>
12
+ <p>Raw characters that must be escaped on output: &lt; and &amp; and &gt; and " and '</p>
13
+ <input type="text" value="a&quot;b&#39;c&amp;d&lt;e&gt;f" placeholder="お名前(全角可)">
14
+ <div data-json='{"key":"value","n":1,"arr":[1,2],"jp":"日本語"}'>JSON in a single-quoted attribute</div>
15
+ <div data-pt-newline="line1
16
+ line2" data-pt-tab="a b">whitespace characters inside attribute values</div>
17
+ <img src="/a.png?x=1&y=2" alt="図: &quot;売上&quot; 推移 &amp; 予測" title='mixed "double" and &#39;single&#39;'>
18
+ </body>
19
+ </html>
@@ -0,0 +1,46 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>comments &amp; raw text &lt;not a tag&gt;</title>
5
+ <!-- a normal comment -->
6
+ <!--[if lt IE 9]>
7
+ <script src="/html5shiv.js"></script>
8
+ <![endif]-->
9
+ <!--[if !IE]><!--><link rel="stylesheet" href="/modern.css"><!--<![endif]-->
10
+ <style>
11
+ /* a comment with <div> and &amp; inside */
12
+ .a::before { content: "<b>&nbsp;</b>"; }
13
+ .b > .c { color: red }
14
+ @media (max-width: 640px) { .d { display: none } }
15
+ </style>
16
+ <script type="application/json" id="seed">
17
+ {"html": "<p>not parsed</p>", "amp": "a & b", "lt": "1 < 2"}
18
+ </script>
19
+ </head>
20
+ <body>
21
+ <!-- comment with -- dashes and a > bracket -->
22
+ <!---->
23
+ <!--- leading dash --->
24
+ <div>text<!--inline comment-->more text</div>
25
+ <script>
26
+ var s = "</scr" + "ipt>";
27
+ if (a < b && c > d) { document.write("<p>&amp;</p>"); }
28
+ </script>
29
+ <noscript><p>JavaScript を有効にしてください &amp; リロード</p></noscript>
30
+ <textarea name="memo" rows="3">
31
+ preserved whitespace
32
+ tab and &amp; entity &lt;b&gt;
33
+ </textarea>
34
+ <pre>
35
+ line one
36
+ indented two
37
+ tabbed three
38
+
39
+ blank line above
40
+ </pre>
41
+ <pre><code>&lt;div class="x"&gt;
42
+ &amp;nbsp;
43
+ &lt;/div&gt;</code></pre>
44
+ <p>after</p>
45
+ </body>
46
+ </html>
@@ -0,0 +1,46 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><title>boolean / empty / valueless attributes</title></head>
4
+ <body>
5
+ <form action="/subscribe" method="post" novalidate>
6
+ <fieldset disabled>
7
+ <input type="text" name="a" disabled>
8
+ <input type="text" name="b" disabled="">
9
+ <input type="text" name="c" disabled="disabled">
10
+ <input type="text" name="d" disabled="DISABLED">
11
+ <input type="text" name="e" disabled="false">
12
+ <input type="checkbox" name="f" checked>
13
+ <input type="checkbox" name="g" checked="checked">
14
+ <input type="checkbox" name="h" CHECKED>
15
+ <input type="radio" name="i" required readonly hidden>
16
+ </fieldset>
17
+ <select multiple size="3">
18
+ <option value="" selected>選択してください</option>
19
+ <option value="1">1</option>
20
+ <option value="2" SELECTED>2</option>
21
+ </select>
22
+ <video controls autoplay muted loop playsinline poster=""></video>
23
+ <audio controls preload="none"></audio>
24
+ <script defer async src="/a.js"></script>
25
+ <button type="submit" DISABLED class="">送信</button>
26
+ </form>
27
+ <img src="/spacer.gif" alt="" width="1" height="1">
28
+ <img src="/deco.png" alt>
29
+ <div class="" id="" data-pt-empty="" data-pt-flag></div>
30
+ <div DATA-PT-UPPER="x" Data-Pt-Mixed="y" CLASS="upper-class-attr">uppercase attribute names</div>
31
+ <hr>
32
+ <br>
33
+ <br/>
34
+ <img src="/x.png" alt="self closed"/>
35
+ <input type="text" name="selfclosed" />
36
+ <area shape="rect" coords="0,0,1,1" href="#a" alt="a">
37
+ <col span="2">
38
+ <embed src="/x.swf" type="application/x-shockwave-flash">
39
+ <source src="/x.mp4" type="video/mp4">
40
+ <track kind="captions" src="/x.vtt" srclang="ja" label="日本語" default>
41
+ <wbr>
42
+ <base href="https://example.com/">
43
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
44
+ <meta name="robots" content="index,follow">
45
+ </body>
46
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><title>大量 class / arbitrary values</title></head>
4
+ <body>
5
+ <div class="group relative isolate flex w-full max-w-[1180px] flex-col items-center justify-between gap-y-6 overflow-hidden rounded-[18px] border border-slate-200/70 bg-white/80 px-4 py-6 shadow-[0_1px_3px_rgba(0,0,0,0.08)] ring-1 ring-inset ring-black/5 backdrop-blur-[6px] transition-[transform,opacity] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] hover:-translate-y-0.5 hover:shadow-lg focus-within:ring-2 sm:flex-row sm:gap-x-8 sm:px-6 md:w-[137px] md:aspect-[4/3] md:rounded-2xl md:px-8 md:py-10 lg:max-w-[1440px] lg:px-12 xl:px-16 2xl:px-20 dark:border-white/10 dark:bg-slate-900/70 dark:ring-white/10 motion-reduce:transition-none print:hidden [&>svg]:size-5 [&_a]:underline data-[state=open]:bg-brand-50 aria-[current=page]:font-bold" data-pt-block="hero-card" data-pt-variant="B" data-state="closed">
6
+ <span class="pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(ellipse_at_top,theme(colors.brand.50),transparent_70%)]"></span>
7
+ <img class="size-[64px] shrink-0 rounded-[50%] object-cover aspect-[1/1]" src="/avatar.png" alt="">
8
+ <p class="text-pretty text-[15px]/[1.6] tracking-[-0.01em] text-slate-700 md:text-[17px]/[1.7]">任意値クラスの組み合わせテスト</p>
9
+ </div>
10
+ </body>
11
+ </html>
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <HTML>
3
+ <HEAD>
4
+ <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
5
+ <TITLE>レガシー HTML4 ドキュメント</TITLE>
6
+ </HEAD>
7
+ <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
8
+ <TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
9
+ <TR><TD ALIGN=CENTER VALIGN=TOP NOWRAP>
10
+ <FONT FACE="MS Pゴシック" SIZE="2" COLOR="#333333">旧来のマークアップ</FONT>
11
+ </TD></TR>
12
+ </TABLE>
13
+ <CENTER><B>太字</B>&nbsp;<I>斜体</I></CENTER>
14
+ <P ALIGN=JUSTIFY>段落です。<BR>改行しました。
15
+ <A HREF="index.html" TARGET="_blank"><IMG SRC="btn.gif" BORDER=0 ALT="ボタン"></A>
16
+ </BODY>
17
+ </HTML>
@@ -0,0 +1,40 @@
1
+ <html>
2
+ <head><title>no doctype: svg / mathml / template / pre newline</title></head>
3
+ <body>
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" preserveAspectRatio="xMidYMid meet" class="icon">
5
+ <title>閉じる</title>
6
+ <desc>close icon</desc>
7
+ <defs>
8
+ <lineargradient id="g1" x1="0" y1="0" x2="1" y2="1">
9
+ <stop offset="0%" stop-color="#fff"></stop>
10
+ <stop offset="100%" stop-color="#000"></stop>
11
+ </lineargradient>
12
+ <clippath id="c1"><rect x="0" y="0" width="10" height="10"></rect></clippath>
13
+ </defs>
14
+ <g clip-path="url(#c1)" fill-rule="evenodd">
15
+ <path d="M6 18 18 6M6 6l12 12" stroke-linecap="round"></path>
16
+ <foreignobject x="0" y="0" width="10" height="10"><div xmlns="http://www.w3.org/1999/xhtml">html in svg</div></foreignobject>
17
+ </g>
18
+ <text textlength="40" lengthadjust="spacing">日本語</text>
19
+ </svg>
20
+ <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
21
+ <mrow><mi>a</mi><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup></mrow>
22
+ <annotation-xml encoding="text/html"><p>html inside mathml</p></annotation-xml>
23
+ </math>
24
+ <template id="row-tpl">
25
+ <tr class="row"><td class="cell">{{value}}</td></tr>
26
+ </template>
27
+ <template id="plain-tpl"><div class="a"><span>b</span></div></template>
28
+ <pre>
29
+ first line has a leading newline in the source</pre>
30
+ <pre>no leading newline</pre>
31
+ <pre>
32
+
33
+ two leading newlines</pre>
34
+ <textarea>
35
+ leading newline in textarea</textarea>
36
+ <textarea>no leading newline</textarea>
37
+ <div>trailing
38
+ </div>
39
+ </body>
40
+ </html>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><title>adoption agency / deep misnesting</title></head>
4
+ <body>
5
+ <p>1<b>2<i>3</b>4</i>5</p>
6
+ <b><p>bold wrapping a p</b> tail</p>
7
+ <a href="/a"><div>block inside a</div></a>
8
+ <b>x<table><td><i>y</b>z</i></td></table>w
9
+ <table><table><tr><td>nested table start tag</td></tr></table></table>
10
+ <form action="/outer"><form action="/inner"><input name="n"></form></form>
11
+ <select><option>a<select><option>b</select></select>
12
+ <button>one<button>two</button>
13
+ <nobr>a<nobr>b<nobr>c</nobr>
14
+ <dl><dt>t1<dd>d1<dt>t2<dd>d2</dl>
15
+ <ruby>漢<rt>かん</rt><rb>字</rb><rt>じ</rt></ruby>
16
+ <div><div><div><div><div><div><div><div><div><div>
17
+ <span><em><strong><small><mark><q><cite><abbr>deep</abbr></cite></q></mark></small></strong></em></span>
18
+ </div></div></div></div></div></div></div></div></div></div>
19
+ <image src="/legacy-image-tag.png" alt="image not img">
20
+ <isindex prompt="legacy">
21
+ <frameset><frame src="/a.html"></frameset>
22
+ <li>bare li</li>
23
+ <td>bare td</td>
24
+ <tr><td>bare tr</td></tr>
25
+ <caption>bare caption</caption>
26
+ <colgroup><col></colgroup>
27
+ </body>
28
+ </html>
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><meta charset="utf-8"><title>character references &amp; control characters</title></head>
4
+ <body>
5
+ <p id="numeric">dec: &#65; &#8364; &#128169; &#12354; | hex: &#x41; &#x20AC; &#x1F4A9; &#x3042;</p>
6
+ <p id="windows1252">C1 remapping: &#128; &#130; &#133; &#136; &#145; &#146; &#149; &#151; &#157; &#159;</p>
7
+ <p id="out-of-range">out of range: &#x110000; &#xFFFF; &#xFFFE; &#0; &#x0; &#xD800; &#xDFFF;</p>
8
+ <p id="unterminated">unterminated: &amp &lt &gt &copy &AMP &notit; &notin; &fjlig;</p>
9
+ <p id="bogus">bogus: &#; &#x; &# ; &&amp;&amp;amp; &12345678901234567890;</p>
10
+ <p id="attrs" title="in attr: &amp &copy= &copy; &#x41; &notit;" data-x="&unknownentity; raw">attribute-context reference rules differ from text-context</p>
11
+ <p id="crlf">carriage
12
+ return
13
+ mixed
14
+ line endings</p>
15
+ <p id="nbsp">nbsp:&nbsp;&nbsp;&#160;&#xA0;and&ensp;&emsp;&thinsp;&zwnj;&zwj;&lrm;&rlm;end</p>
16
+ <p id="astral">astral: 𝕳𝖊𝖑𝖑𝖔 🧑‍🚀 👩🏽‍💻 🏴󠁧󠁢󠁳󠁣󠁴󠁿</p>
17
+ <p id="combining">combining: がガ ガ e&#769; ế</p>
18
+ <p id="bidi">bidi: العربية עברית &#x202E;reversed&#x202C;</p>
19
+ <p id="tab-ff">tab: formfeed:vtab:end</p>
20
+ <div data-pt-ctl="a&#9;b&#10;c&#13;d">control chars inside attribute value</div>
21
+ <p>&lt;script&gt;alert(1)&lt;/script&gt; stays text</p>
22
+ </body>
23
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><title>namespaces, custom elements, duplicate attributes</title></head>
4
+ <body>
5
+ <div class="first" class="second" id="a" ID="b" data-x="1" DATA-X="2">duplicate attribute names</div>
6
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 10 10">
7
+ <use xlink:href="#sym" xlink:title="リンク"></use>
8
+ <text xml:lang="ja" xml:space="preserve"> spaced </text>
9
+ <a xlink:href="https://example.com/"><circle cx="5" cy="5" r="4"></circle></a>
10
+ <ellipse rx="1" ry="2" transform="rotate(45)"></ellipse>
11
+ <animatetransform attributeName="transform" repeatCount="indefinite"></animatetransform>
12
+ <fecolormatrix in="SourceGraphic" type="saturate" values="0"></fecolormatrix>
13
+ <textpath startOffset="10%" href="#p">along path</textpath>
14
+ </svg>
15
+ <pt-hero data-pt-block="hero" ALIGN="center">custom element lowercase</pt-hero>
16
+ <PT-Card data-pt-block="card">custom element mixed case</PT-Card>
17
+ <my-widget-2 disabled foo:bar="ns-ish attribute name"></my-widget-2>
18
+ <div data-="empty name suffix" -dash="leading dash" _under="underscore" x:y="colon" ns\:z="backslash"></div>
19
+ <p xml:lang="en" lang="EN-us" dir="AUTO" translate="NO">lang/dir casing</p>
20
+ <div style="COLOR: RED; Background-Image: url('/a.png')">inline style casing</div>
21
+ <a href="HTTPS://Example.COM/Path?Q=1#Frag">uppercase url</a>
22
+ <table><svg><g><foreignobject><div>svg inside table</div></foreignobject></g></svg><tr><td>cell</td></tr></table>
23
+ <math><mtext><table><tr><td>table inside mtext</td></tr></table></mtext></math>
24
+ </body>
25
+ </html>