Skip to content

Commit 7df6416

Browse files
committed
chore: add nuxt html validator patch
1 parent 58d4796 commit 7df6416

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/dist/module.mjs b/dist/module.mjs
2+
index 62bb9c885e18652f48f6c067258f3ad70582b1f5..eb62642ba197cb7070708bdd01d733a790fb7d6f 100644
3+
--- a/dist/module.mjs
4+
+++ b/dist/module.mjs
5+
@@ -82,7 +82,7 @@ const module = defineNuxtModule({
6+
}
7+
if (!nuxt.options.dev) {
8+
const validatorPath = await resolvePath(fileURLToPath(new URL("./runtime/validator", import.meta.url)));
9+
- const { useChecker, getValidator } = await (isWindows ? import(pathToFileURL(validatorPath).href) : import(validatorPath));
10+
+ const { useChecker, getValidator, isIgnored } = await (isWindows ? import(pathToFileURL(validatorPath).href) : import(validatorPath));
11+
const validator = getValidator(options);
12+
const { checkHTML, invalidPages } = useChecker(validator, usePrettier, logLevel);
13+
if (failOnError) {
14+
@@ -98,7 +98,7 @@ const module = defineNuxtModule({
15+
if (!route.contents || !route.fileName?.endsWith(".html")) {
16+
return;
17+
}
18+
- if (route.contents.match(NuxtRedirectHtmlRegex)) {
19+
+ if (route.contents.match(NuxtRedirectHtmlRegex) || isIgnored(route.route, moduleOptions.ignore)) {
20+
return;
21+
}
22+
checkHTML(route.route, route.contents);

0 commit comments

Comments
 (0)