Skip to content

Commit 0d41eb3

Browse files
authored
Fail loudly in EntryText if Markdown render failed (#335)
1 parent 22ecddb commit 0d41eb3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/guidelines/EntryText.astro

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ const howtoPath = parentHowto
2222
const baseUrl = "https://w3c.github.io/wcag3/how-to/";
2323
2424
function processHtml() {
25-
const entryHtml = entry.rendered!.html;
25+
if (!entry.rendered) {
26+
throw new Error(
27+
`EntryText: No rendered HTML found for ${entry.id}; check for Markdown parse failures earlier in log`
28+
);
29+
}
30+
const entryHtml = entry.rendered.html;
2631
if (!howtoSlug) return entryHtml;
2732
2833
const $ = load(entryHtml, null, false);

0 commit comments

Comments
 (0)