Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/site/src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const repo = defineCollection({
]) {
const body = await getRepoMarkdown(path);
const rendered = await renderMarkdown(body);
// Raw HTML in these files goes onto the page as markup. A tag meant as
// text, like <template shadowrootmode>, must be in backticks, or it
// becomes a live element: fail the build rather than ship that.
const live = rendered.html.match(/<(template|script|iframe|object|embed)\b[^>]*>/i);
if (live) throw new Error(`${path} renders a live ${live[0]}; put it in backticks`);
// Wide tables scroll sideways on a phone, and can be scrolled from the keyboard.
rendered.html = rendered.html
.replaceAll('<table>', '<div class="table-scroll" role="region" aria-label="Table" tabindex="0"><table>')
Expand Down