Skip to content

feat: Support headerless table syntax - #8

Merged
Fuyeors merged 1 commit into
mainfrom
feat/headerless-tables
Aug 24, 2026
Merged

feat: Support headerless table syntax#8
Fuyeors merged 1 commit into
mainfrom
feat/headerless-tables

Conversation

@Fuyeors

@Fuyeors Fuyeors commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Support separator-first tables as headerless data tables.
  • Use the separator row to determine column count and left/center/right alignment.
  • Omit <thead> for headerless tables while retaining <tbody> rows.
  • Preserve headed-table parsing and add regression coverage for both forms.

Example

| :--- | ---: |
| Ray ID | a2c5ac427b7aa727 |
| IP address | 172.214.47.18 |

renders as a table containing only <tbody>, with the first column aligned left and the second aligned right.

Validation

Check Result
TypeScript typecheck Pass
Parser unit tests 13/13 pass
FFM regression tests 10 pass, 458 skipped by existing filters
Prettier check Pass
git diff --check Pass

Performance and memory

Benchmarks used five runs per scenario with the same Node/Vitest setup and 500-row inputs. Values below are medians per parse/render iteration.

Scenario Time Sampled peak heap
Existing headed table, no alignment 2.428 ms → 2.530 ms (+4.2%) 2.26 MiB → 2.53 MiB (+12.0%)
Existing aligned headed table 2.437 ms → 2.732 ms (+12.1%) 12.60 MiB → 7.48 MiB (-40.6%)
New headerless table 1.971 ms 9.11 MiB
Ordinary pipe text, not a table 0.794 ms → 0.839 ms (+5.7%) 13.22 MiB → 3.32 MiB (-74.9%)

The headerless case has no semantically equivalent baseline because the previous implementation treated the separator-first input as ordinary text. Its absolute cost is lower than the existing 500-row headed-table path. The aligned headed output now includes the required alignment attributes, so its time comparison includes the additional HTML output work.

Package size

The package has no build script and exports source files directly. npm pack comparison against origin/main showed:

  • Tarball: 33,99635,200 bytes (+1,204, +3.54%).
  • Unpacked package: 203,166207,479 bytes (+4,313, +2.12%).

The size increase includes the implementation, renderer changes, and regression tests.

@Fuyeors
Fuyeors merged commit a4f90d6 into main Aug 24, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant