From b2ee080bc537e97aecec7661e572fda5ce29960d Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Tue, 24 Feb 2026 23:21:47 +0800 Subject: [PATCH] fix compiler docs titles --- packages/svelte/scripts/process-messages/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/svelte/scripts/process-messages/index.js b/packages/svelte/scripts/process-messages/index.js index 1904f1dfb4..4d60bdcb18 100644 --- a/packages/svelte/scripts/process-messages/index.js +++ b/packages/svelte/scripts/process-messages/index.js @@ -71,13 +71,17 @@ function run() { ); } + // compile errors and warnings don't have sub-categories so they must use the + // h2 notation to correctly display in the 'On this page' list of the docs site + const heading_notation = category.startsWith('compile-') ? '##' : '###'; + fs.writeFileSync( `${DIR}/${category}.md`, '\n\n' + Object.entries(messages[category]) .map(([code, { messages, details }]) => { const chunks = [ - `### ${code}`, + `${heading_notation} ${code}`, ...messages.map((message) => '```\n' + message + '\n```') ];