diff --git a/hugo/layouts/shortcodes/tut-menu.html b/hugo/layouts/shortcodes/tut-menu.html index 4b3880e9e..c83815b26 100644 --- a/hugo/layouts/shortcodes/tut-menu.html +++ b/hugo/layouts/shortcodes/tut-menu.html @@ -18,7 +18,7 @@ {{- $firstPass := split $raw " > " -}} {{- $segments := slice -}} {{- range $firstPass -}} - {{- if contains . "→" -}} + {{- if strings.Contains . "→" -}} {{- range split . "→" -}} {{- $segments = $segments | append (trim . " ") -}} {{- end -}} diff --git a/package.json b/package.json index 41f57b5c1..806fc2f62 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "backfill-attachments": "tsx scripts/backfill-attachments.ts", "preflight:ai-quiz-smoke": "tsx scripts/preflight-ai-quiz-smoke.ts", "prebuild:shared-bundle": "node scripts/bundle-shared.cjs", - "prebuild:parsers-bundle": "esbuild scripts/parsers/index.ts --bundle --platform=node --format=esm --outfile=srv-qa/lib/parsers.bundle.mjs --external:node:* --banner:js=\"import { createRequire } from 'module'; const require = createRequire(import.meta.url);\"", + "prebuild:parsers-bundle": "esbuild scripts/parsers/index.ts --bundle --platform=node --format=esm --outfile=srv-qa/lib/parsers.bundle.mjs --external:node:* --banner:js=\"import { createRequire as __cjsBundleRequire } from 'module'; const require = __cjsBundleRequire(import.meta.url);\"", "check:security-annotations": "node scripts/check-hugo-safe-html.cjs", "check:api-docs-drift": "node scripts/check-api-docs-drift.cjs", "check:security-txt-drift": "node scripts/check-security-txt-drift.cjs", diff --git a/test/parsers/option-codeblock-indent-css.test.ts b/test/parsers/option-codeblock-indent-css.test.ts index ab465bb05..81306cf65 100644 --- a/test/parsers/option-codeblock-indent-css.test.ts +++ b/test/parsers/option-codeblock-indent-css.test.ts @@ -34,7 +34,7 @@ describe('#2820 — trailing code-box indent after OPTION blocks', () => { '.step-content > .os-options ~ p', '.step-content > .os-options ~ figure', '.step-content > .os-options ~ pre', - '.step-content > .os-options ~ blockquote', + '.step-content > .os-options ~ :is(blockquote, aside, details)', ]) { expect(t).toContain(sel) } diff --git a/test/parsers/render-blockquote-hook.test.ts b/test/parsers/render-blockquote-hook.test.ts index 8790d6465..5addec894 100644 --- a/test/parsers/render-blockquote-hook.test.ts +++ b/test/parsers/render-blockquote-hook.test.ts @@ -15,8 +15,15 @@ describe('render-blockquote hook', () => { expect(t).toMatch(/
\s*\{\{[-\s]*\.Text/) }) - it('emits a semantic alert class for alert blockquotes', () => { + it('delegates alert blockquotes to the tut-alert partial, which emits a semantic alert class', () => { + // #2595/#71a8d70bc: the alert branch no longer emits the class inline; it + // delegates to partials/tut-alert.html, passing .AlertType as `type`. The + // semantic `alert alert-` class is emitted by the partial. const t = readFileSync(p, 'utf8') - expect(t).toContain('class="alert alert-{{ .AlertType }}"') + expect(t).toMatch(/partial\s+"tut-alert\.html"/) + expect(t).toContain('"type" .AlertType') + + const partial = readFileSync('hugo/layouts/partials/tut-alert.html', 'utf8') + expect(partial).toContain('class="alert alert-{{ $type }}"') }) }) diff --git a/test/unit/option-tail-leak.test.ts b/test/unit/option-tail-leak.test.ts index 529fa15d3..c17c26ccb 100644 --- a/test/unit/option-tail-leak.test.ts +++ b/test/unit/option-tail-leak.test.ts @@ -155,9 +155,12 @@ describe('OPTION group followed by shared prose/image/tips (#2820 regression)', expect(text).not.toContain('[!TIP]'); }); - it('renders both TIPs as alert-tip blockquotes', () => { + it('renders both TIPs as alert-tip callouts', () => { + // #2595/#71a8d70bc: `> [!TIP]` alerts now render via the tut-alert partial + // as non-collapsible