diff --git a/scripts/lib/docs.css b/scripts/lib/docs.css index d5ab6f9c..24d2d5d6 100644 --- a/scripts/lib/docs.css +++ b/scripts/lib/docs.css @@ -972,6 +972,7 @@ html[data-color-mode="dark"] .markdown-body li.task-list-item:not(.is-static).is border-radius: 0; box-shadow: inset 3px 0 var(--borderColor-muted, #d0d7de); overflow-x: auto; + white-space: pre-wrap; } .markdown-body .markdown-editor-pre > code { diff --git a/scripts/lib/marked-setup.js b/scripts/lib/marked-setup.js index 208fa403..f400d951 100644 --- a/scripts/lib/marked-setup.js +++ b/scripts/lib/marked-setup.js @@ -78,7 +78,10 @@ function setupBasePlugins() { marked.use(markedHighlight({ langPrefix: 'hljs language-', highlight(code, lang) { - const language = hljs.getLanguage(lang) ? lang : 'plaintext'; + // Markdown workflow files contain YAML frontmatter + a prose brief, + // so YAML highlighting renders them more usefully than markdown mode. + const effectiveLang = (lang === 'markdown' || lang === 'md') ? 'yaml' : lang; + const language = hljs.getLanguage(effectiveLang) ? effectiveLang : 'plaintext'; return hljs.highlight(code, { language }).value; }, })); @@ -95,7 +98,7 @@ function setupBasePlugins() { return `
${codeHtml}\n${codeHtml}\n${codeHtml}\n${codeHtml}\n