fix: invalid html structure (#1668)

This commit is contained in:
Marvin Hagemeister
2023-08-17 17:44:26 +02:00
committed by GitHub
parent 899a3e0dc9
commit a4cf4939ee
2 changed files with 18 additions and 4 deletions
+4 -4
View File
@@ -94,11 +94,11 @@ export function renderOuterDocument(
h("script", { src: src, nonce, type: "module" })
),
headVNodes,
h("body", {
...docBody,
dangerouslySetInnerHTML: { __html: opts.bodyHtml },
}),
),
h("body", {
...docBody,
dangerouslySetInnerHTML: { __html: opts.bodyHtml },
}),
);
try {
+14
View File
@@ -5,6 +5,7 @@ import {
fetchHtml,
withFresh,
} from "$fresh/tests/test_utils.ts";
import { assertNotMatch } from "$std/testing/asserts.ts";
Deno.test("doesn't apply internal app template", async () => {
await withFresh(
@@ -78,3 +79,16 @@ Deno.test("sets <html> + <head> + <body> classes", async () => {
},
);
});
// Issue: https://github.com/denoland/fresh/issues/1666
Deno.test("renders valid html document", async () => {
await withFresh(
"./tests/fixture_explicit_app/main.ts",
async (address) => {
const res = await fetch(address);
const text = await res.text();
assertNotMatch(text, /<\/body><\/head>/);
},
);
});