diff --git a/package.json b/package.json index 9e41466a1..1ecdf1873 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@tanstack/ai-client": "^0.11.3", "@tanstack/ai-openai": "^0.9.5", "@tanstack/create": "^0.69.0", - "@tanstack/highlight": "^0.0.8", + "@tanstack/highlight": "^0.0.9", "@tanstack/markdown": "^0.0.11", "@tanstack/pacer": "^0.21.1", "@tanstack/react-hotkeys": "^0.10.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb0131cc9..9c9f195d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,8 +100,8 @@ importers: specifier: ^0.69.0 version: 0.69.0(tslib@2.8.1) '@tanstack/highlight': - specifier: ^0.0.8 - version: 0.0.8 + specifier: ^0.0.9 + version: 0.0.9 '@tanstack/markdown': specifier: ^0.0.11 version: 0.0.11(react@19.2.3) @@ -3323,8 +3323,8 @@ packages: peerDependencies: solid-js: '>=1.9.7' - '@tanstack/highlight@0.0.8': - resolution: {integrity: sha512-v+QMPdA/g8ni3/wpd6UzRVvpBvKlxBXwe6XlCOZIUbamUaMWcBBFdrk4fvKKh2ArgFghWcP0rAQc5X8iQGNDYg==} + '@tanstack/highlight@0.0.9': + resolution: {integrity: sha512-vWuVpuSprbsEq5gle5vp2CEBNVue65m09idkbv0rcCPFn3XnxzZg1Q9kownk24iCag6tJdfd/gtKSwllPbQvSA==} engines: {node: '>=18'} '@tanstack/history@1.162.0': @@ -9641,7 +9641,7 @@ snapshots: - csstype - utf-8-validate - '@tanstack/highlight@0.0.8': {} + '@tanstack/highlight@0.0.9': {} '@tanstack/history@1.162.0': {} diff --git a/tests/code-highlighting.test.ts b/tests/code-highlighting.test.ts index e6ffcd418..cda46e666 100644 --- a/tests/code-highlighting.test.ts +++ b/tests/code-highlighting.test.ts @@ -2,6 +2,7 @@ import assert from 'node:assert/strict' import test from 'node:test' import { defaultHighlighter } from '@tanstack/highlight' import { renderCodeFence } from '@tanstack/highlight/markdown' +import { createThemeBaseCss } from '@tanstack/highlight/theme' test('inline diff notation renders as line decorations', () => { const rendered = renderCodeFence( @@ -23,3 +24,13 @@ test('inline diff notation renders as line decorations', () => { assert.match(rendered.htmlMarkup, /th-line--inserted/) assert.doesNotMatch(rendered.htmlMarkup, /!code/) }) + +test('wrapped code lines occupy one visual row each', () => { + const css = createThemeBaseCss() + + assert.match( + css, + /\.th-line \{ display: inline-block; min-width: 100%; width: max-content; \}/, + ) + assert.doesNotMatch(css, /\.th-line \{ display: block;/) +})