Skip to content

Add Markdown table support#243

Merged
janezd merged 1 commit into
biolab:masterfrom
jpers1:add-markdown-table-support
Jun 14, 2026
Merged

Add Markdown table support#243
janezd merged 1 commit into
biolab:masterfrom
jpers1:add-markdown-table-support

Conversation

@jpers1

@jpers1 jpers1 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Add GitHub-style Markdown table support to notes content.

This changes the MDX pipeline to recognize GFM tables, adds conservative prose-scoped table styling, and documents the capability briefly in the README.

Why

Notes content currently renders pipe-delimited table syntax as plain text because the MDX compiler is not using remark-gfm.

There are two MDX compile paths in this repository:

  • the main content serialization path
  • the quiz extraction path used when content includes <Question> blocks

Both paths need the same table parsing support. Updating only the main serializer would leave mixed content inconsistent or broken.

Changes

  • add remark-gfm to dependencies
  • enable remark-gfm in ingest/md-helpers.ts
  • enable remark-gfm in ingest/questions.ts
  • add scoped .prose table styling in styles/globals.scss
  • add a short README note that notes content supports GitHub-style Markdown tables

Scope

This PR is intentionally small:

  • no API or schema changes
  • no changes to non-prose tables
  • no broader Markdown authoring work
  • no table-specific responsive wrapper logic

Validation

  • confirmed the main serializer emits table markup for Markdown tables
  • confirmed quiz extraction accepts content that mixes a Markdown table with <Question>
  • confirmed the serializer still handled table, math, and fenced code content together

yarn ingest is currently blocked by an unrelated existing TypeScript issue in scripts/ingest.ts related to tree-kill typings, so full ingest validation was not possible within this change.

@jpers1

jpers1 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Reviewer note: this updates both MDX compile paths intentionally. serializedContent handles chapter rendering, but extractQuizzes recompiles MDX separately when chapters include <Question> blocks. Enabling GFM only in the main serializer would leave chapters that mix tables and questions inconsistent.

The small CSS block is included in the same PR because parser support alone would render unstyled semantic tables in prose. The rules are scoped to .prose to avoid affecting quiz/admin tables or broader app layout.

@janezd janezd merged commit 927e6ca into biolab:master Jun 14, 2026
1 check 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.

2 participants