fix: invalid html structure (#1668)
This commit is contained in:
@@ -94,11 +94,11 @@ export function renderOuterDocument(
|
|||||||
h("script", { src: src, nonce, type: "module" })
|
h("script", { src: src, nonce, type: "module" })
|
||||||
),
|
),
|
||||||
headVNodes,
|
headVNodes,
|
||||||
h("body", {
|
|
||||||
...docBody,
|
|
||||||
dangerouslySetInnerHTML: { __html: opts.bodyHtml },
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
|
h("body", {
|
||||||
|
...docBody,
|
||||||
|
dangerouslySetInnerHTML: { __html: opts.bodyHtml },
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
fetchHtml,
|
fetchHtml,
|
||||||
withFresh,
|
withFresh,
|
||||||
} from "$fresh/tests/test_utils.ts";
|
} from "$fresh/tests/test_utils.ts";
|
||||||
|
import { assertNotMatch } from "$std/testing/asserts.ts";
|
||||||
|
|
||||||
Deno.test("doesn't apply internal app template", async () => {
|
Deno.test("doesn't apply internal app template", async () => {
|
||||||
await withFresh(
|
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>/);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user