Skip to content

bug(synth-md-gfm): Table parsing not working #13

@shtse8

Description

@shtse8

Package

@sylphx/synth-md-gfm@0.2.3

Environment

  • @sylphx/synth-md: latest
  • bun: 1.3.3
  • Platform: macOS arm64

Description

GFM tables are not being parsed as table nodes. Instead, they are parsed as paragraph nodes when using the gfmPlugin().

Steps to Reproduce

import { parse } from '@sylphx/synth-md'
import { gfmPlugin } from '@sylphx/synth-md-gfm'

const md = `# Heading

| col1 | col2 |
|------|------|
| a    | b    |

Text after.
`

const tree = parse(md, { plugins: [gfmPlugin()] })
tree.nodes.forEach((n, i) => console.log(`${i}: ${n.type}`))

Expected Output

0: root
1: heading
2: text
3: table        <-- should be table
4: paragraph
5: text

Actual Output

0: root
1: heading
2: text
3: paragraph    <-- table parsed as paragraph
4: text

Additional Context

  • gfmPlugin exports: gfmPlugin, tryTokenizeAutolink, tryTokenizeStrikethrough, tryTokenizeTable
  • Tested with various table formats (with/without alignment, different spacing)
  • Strikethrough and autolinks not tested but may have similar issues

Impact

This blocks GFM table support in @sylphx/coderag for semantic code chunking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions