Skip to content

Commit 4e5bd60

Browse files
authored
Merge branch 'master' into update-hightable
2 parents 7730ca8 + 929d360 commit 4e5bd60

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@
5656
},
5757
"dependencies": {
5858
"hightable": "0.19.4",
59-
"hyparquet": "1.17.8",
59+
"hyparquet": "1.18.0",
6060
"hyparquet-compressors": "1.1.1",
6161
"icebird": "0.3.0",
6262
"react": "18.3.1",
6363
"react-dom": "18.3.1"
6464
},
6565
"devDependencies": {
6666
"@eslint/js": "9.35.0",
67-
"@storybook/react-vite": "9.1.5",
67+
"@storybook/react-vite": "9.1.6",
6868
"@testing-library/react": "16.3.0",
69-
"@types/node": "24.3.2",
69+
"@types/node": "24.5.1",
7070
"@types/react": "19.1.13",
7171
"@types/react-dom": "19.1.9",
7272
"@vitejs/plugin-react": "5.0.2",
@@ -77,10 +77,10 @@
7777
"eslint-plugin-react-refresh": "0.4.20",
7878
"eslint-plugin-storybook": "9.1.5",
7979
"globals": "16.4.0",
80-
"jsdom": "26.1.0",
80+
"jsdom": "27.0.0",
8181
"nodemon": "3.1.10",
8282
"npm-run-all": "4.1.5",
83-
"storybook": "9.1.5",
83+
"storybook": "9.1.6",
8484
"typescript": "5.8.3",
8585
"typescript-eslint": "8.43.0",
8686
"vite": "7.1.5",

src/components/Markdown/Markdown.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,4 +536,17 @@ describe('Markdown with tables', () => {
536536
expect(getByText('Row 2')).toBeDefined()
537537
expect(getByText('Data 2')).toBeDefined()
538538
})
539+
540+
it('renders a table without preceding newline', () => {
541+
const text = 'Oldest houses:\n| id | year |\n|---|---|\n| 83 | 1920 |\n| 19 | 1951 |'
542+
const { getByText, getByRole } = render(<Markdown text={text} />)
543+
expect(getByRole('table')).toBeDefined()
544+
expect(getByText('id')).toBeDefined()
545+
expect(getByText('year')).toBeDefined()
546+
expect(getByText('83')).toBeDefined()
547+
expect(getByText('1920')).toBeDefined()
548+
expect(getByText('19')).toBeDefined()
549+
expect(getByText('1951')).toBeDefined()
550+
expect(getByText('Oldest houses:')).toBeDefined()
551+
})
539552
})

src/components/Markdown/Markdown.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ function parseMarkdown(text: string): Token[] {
152152
if (/^(#{1,6})\s+/.test(ln)) break // heading
153153
if (/^(\s*)([-*+]|\d+\.)\s+/.test(ln)) break // list item
154154
if (/^---+$/.test(ln.trim())) break // horizontal rule
155+
// table start: a header row followed by a separator row
156+
if (ln.includes('|') && i + 1 < lines.length) {
157+
const sepLine = lines[i + 1] ?? ''
158+
const tableSepRegex = /^\s*\|?\s*:?[-]+:?\s*(\|\s*:?[-]+:?\s*)*\|?\s*$/
159+
if (sepLine.includes('|') && tableSepRegex.test(sepLine)) break
160+
}
155161

156162
paraLines.push(ln)
157163
i++

src/lib/workers/parquetWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ self.onmessage = async ({ data }: { data: ClientMessage }) => {
3636
const rows = (await parquetReadObjects({ ...options, rowFormat: 'object', file, compressors, onChunk, onPage })) as Rows
3737
postParquetReadObjectsResultMessage({ queryId, rows })
3838
} else if (kind === 'parquetQuery') {
39-
const rows = (await parquetQuery({ ...options, rowFormat: 'object', file, compressors, onComplete, onChunk, onPage })) as Rows
39+
const rows = await parquetQuery({ ...options, file, compressors, onChunk, onPage })
4040
postParquetQueryResultMessage({ queryId, rows })
4141
} else {
4242
await parquetRead({ ...options, rowFormat: 'object', file, compressors, onComplete, onChunk, onPage })
@@ -46,7 +46,7 @@ self.onmessage = async ({ data }: { data: ClientMessage }) => {
4646
postErrorMessage({ error: error as Error, queryId })
4747
}
4848

49-
function onComplete(rows: Rows) {
49+
function onComplete(rows: unknown[][] | Record<string, unknown>[]) {
5050
postCompleteMessage({ queryId, rows })
5151
}
5252
function onChunk(chunk: ColumnData) {

0 commit comments

Comments
 (0)