Skip to content

Hover card DX#55

Merged
benjaminleonard merged 5 commits into
mainfrom
hover-card-dx
Jun 10, 2026
Merged

Hover card DX#55
benjaminleonard merged 5 commits into
mainfrom
hover-card-dx

Conversation

@benjaminleonard

@benjaminleonard benjaminleonard commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Pulls three useful things up from the docs site.

plainText(inlines) — flattens an inline AST to visible plain text, entity-decoded. Merges the app's inlineText + decodeEntities. The walk is coupled to the InlineNode union and the library owns the decision to leave numeric entities (’) in text nodes, so it should own resolving them on the way to plain text. The per-node switch is exhaustive with a never default — adding a node type is now a compile error here rather than a silent drop (the bug that motivated this: an app-side copy broke when the union gained raw). Helpful for something like a hover card or search section preview.

Block union fix — adds ListBlock, DListBlock, ListItemBlock, and Cell to the public Block union. items/cell shapes are now reachable without casting (block as { items?: … }).

findSection(blocks, id) — depth-first find-by-id over the block AST, descending through child blocks, list items, and table cells.

Canary: npm install @oxide/react-asciidoc@2.0.0-canary.bd2aad7

This reverts commit 249629c.
@benjaminleonard benjaminleonard merged commit 3a1e264 into main Jun 10, 2026
3 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