From bfaff6b0e1fb60b16819e9a44b4ef13e883143a9 Mon Sep 17 00:00:00 2001 From: James Bradley Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] H tags (#28) * Failing test * Allow numbers in el name tests * Allow numbers in el names --- src/snapshot.ts | 2 +- test/__snapshots__/integration.ts.snap | 9 +++++---- test/html/basic.html | 4 ++-- test/html/invalid-tagname.html | 3 +-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/snapshot.ts b/src/snapshot.ts index 656de6ea..2d500d27 100644 --- a/src/snapshot.ts +++ b/src/snapshot.ts @@ -8,7 +8,7 @@ import { } from './types'; let _id = 1; -const symbolAndNumberRegex = RegExp('[^a-z]'); +const symbolAndNumberRegex = RegExp('[^a-z1-6]'); function genId(): number { return _id++; diff --git a/test/__snapshots__/integration.ts.snap b/test/__snapshots__/integration.ts.snap index 715debc7..1e70a295 100644 --- a/test/__snapshots__/integration.ts.snap +++ b/test/__snapshots__/integration.ts.snap @@ -45,7 +45,8 @@ exports[`[html file]: basic.html 1`] = ` Document -" + +

Title

" `; exports[`[html file]: block-element.html 1`] = ` @@ -184,8 +185,8 @@ exports[`[html file]: invalid-tagname.html 1`] = `
Hello
Hello
-
Hello
-
" +
+" `; exports[`[html file]: picture.html 1`] = ` @@ -222,7 +223,7 @@ exports[`[html file]: with-relative-res.html 1`] = `
Hello
-
Hello
+ Hello
Hello
\\"\\" diff --git a/test/html/basic.html b/test/html/basic.html index 95fac2be..44d38cba 100644 --- a/test/html/basic.html +++ b/test/html/basic.html @@ -9,7 +9,7 @@ - +

Title

- \ No newline at end of file + diff --git a/test/html/invalid-tagname.html b/test/html/invalid-tagname.html index 4d9183df..e28dd710 100644 --- a/test/html/invalid-tagname.html +++ b/test/html/invalid-tagname.html @@ -8,8 +8,7 @@ Hello - Hello Hello - \ No newline at end of file +