Skip to content

feat: parse :icon-name: syntax in table cells#11

Merged
teezeit merged 3 commits into
mainfrom
copilot/feat-icons-in-table-cells
Apr 19, 2026
Merged

feat: parse :icon-name: syntax in table cells#11
teezeit merged 3 commits into
mainfrom
copilot/feat-icons-in-table-cells

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 18, 2026

Adds support for :icon-name: at the start of table cell content, emitting an icon node followed by a text node for any trailing content. Works in both header and body cells.

Changes

src/parser/transformer.ts

  • In transformTable, cell text nodes are now tested against /^:([a-z-]+):\s*([\s\S]*)$/
  • On match: pushes an icon node (props.name = captured name) and, if non-empty trailing text exists (trimmed), a text node
  • Non-matching cells fall through unchanged

tests/parser.test.ts

  • New "Icon in Table Cells" suite covering: icon + trailing text, icon-only, hyphenated names (:arrow-right:), header cells, and non-icon cells

Example

| Status | Item |
|--------|------|
| :check: Done | Task A |
| :x: Failed   | Task B |

Parses the first body cell as [{ type: 'icon', props: { name: 'check' } }, { type: 'text', content: 'Done' }].

Copilot AI linked an issue Apr 18, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits April 18, 2026 12:20
Copilot AI changed the title [WIP] Add support for icons in table cells via :icon-name: syntax feat: parse :icon-name: syntax in table cells Apr 18, 2026
Copilot AI requested a review from teezeit April 18, 2026 12:22
@teezeit teezeit marked this pull request as ready for review April 19, 2026 20:46
@teezeit teezeit merged commit 35da0ce into main Apr 19, 2026
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.

feat: icons in table cells via :icon-name: syntax

2 participants