Skip to content

Commit f6aaebc

Browse files
committed
Fix generated HTML
1 parent 48aacc1 commit f6aaebc

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

javascript/html/LinksHead.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { html, raw } from "hono/html";
1+
import { html } from "hono/html";
22
import type { FC } from "hono/jsx";
33

44
const HtmlHeadPart1: FC = () => {
@@ -116,12 +116,13 @@ const LinksHead: FC<LinksHeadProps> = ({
116116
toIndexFolder,
117117
version
118118
}) => {
119-
return html`
119+
return (
120120
<head>
121-
${(<HtmlHeadPart1 />)} ${raw(children)}
122-
${(<HtmlHeadPart2 toIndexFolder={toIndexFolder} />)}
121+
<HtmlHeadPart1 />
122+
{children}
123+
<HtmlHeadPart2 toIndexFolder={toIndexFolder} />
123124
</head>
124-
`;
125+
);
125126
};
126127

127128
export default LinksHead;

javascript/htmlContent.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { html } from "hono/html";
1+
import { html, raw } from "hono/html";
2+
import Attribution from "./html/Attribution.js";
3+
import Navigation from "./html/Navigation.js";
24
import type { WriteBuffer, WriteBufferElement } from "./types.js";
35
import { JsVersionEdition, JsVersionLegend } from "./versions/js.js";
46
import { SplitVersionEdition, SplitVersionLegend } from "./versions/split.js";
5-
import Navigation from "./html/Navigation.js";
6-
import Attribution from "./html/Attribution.js";
77

88
const shortTitleDefault: WriteBufferElement = `SICP &mdash; JS`;
99
const longTitleDefault: WriteBufferElement = `Structure and Interpretation of Computer Programs &mdash; Comparison Edition`;
@@ -55,15 +55,15 @@ export const html_links_part2 = (
5555
title="Go back to front page"
5656
href="${toIndexFolder}index.html"
5757
class="gray"
58-
>${shortTitle}</a
58+
>${raw(shortTitle)}</a
5959
></span
6060
>
6161
<span class="navbar-brand-long"
6262
><a
6363
title="Go back to front page"
6464
href="${toIndexFolder}index.html"
6565
class="gray"
66-
>${longTitle}</a
66+
>${raw(longTitle)}</a
6767
></span
6868
>`
6969
);

javascript/parseXmlHtml.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from "./processingFunctions/index.js";
2121
import LinksHead from "./html/LinksHead.js";
2222
import type { WriteBuffer } from "./types.js";
23+
import { raw } from "hono/html";
2324

2425
let paragraph_count = 0;
2526
let heading_count = 0;
@@ -837,8 +838,8 @@ const beforeContent = (writeTo: WriteBuffer) => {
837838
writeTo.push(html_links_part1);
838839
writeTo.push(
839840
<LinksHead toIndexFolder={toIndexFolder} version="js">
840-
<meta name="description" content={pageTitle} />
841-
<title>{pageTitle}</title>
841+
<meta name="description" content={raw(pageTitle)} />
842+
<title>{raw(pageTitle)}</title>
842843
</LinksHead>
843844
);
844845
html_links_part2(writeTo, toIndexFolder, "js");

0 commit comments

Comments
 (0)