* feat: add useIsBlockIncomplete hook for detecting incomplete streaming blocks
Custom components can now detect when the block they're rendering is still
being streamed (incomplete). This is useful for showing loading states in
code blocks during streaming.
- Add BlockIncompleteContext and useIsBlockIncomplete hook
- Add hasIncompleteCodeFence utility to detect unclosed code fences
- Calculate isIncomplete state per block during render
- Default CodeComponent uses the hook to set data-incomplete attribute
- Add comprehensive tests for the new functionality
* docs: add useIsBlockIncomplete documentation
- Add "Streaming State" section to components.mdx explaining the hook
- Add "Avoid Continuous Re-rendering" section to mermaid.mdx with example
* fix: support tilde code fences in hasIncompleteCodeFence
Adds support for detecting incomplete ~~~ code fences in addition to
backtick fences, per CommonMark/GFM spec.
* fix: address PR review — line-based fence detection, rename hook/context
- rewrite hasIncompleteCodeFence to walk line-by-line per CommonMark spec
- fixes 6+ backtick fences being miscounted
- fixes false positives from inline backticks in prose
- respects fence character matching and length requirements
- rename block-position-context.ts → block-incomplete-context.ts
- rename useIsBlockIncomplete → useIsCodeFenceIncomplete
- add tests for edge cases (long fences, inline backticks, indentation)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Add support for copying table data as Markdown in TableCopyDropdown
* Refactor content generation in TableCopyDropdown to use formatters for cleaner code
* docs: add changeset
The footnote reference and definition patterns used [^\]\s] which matches
any character except ] and whitespace. This incorrectly detected regex
negated character classes like [^\s...] in code blocks as footnotes,
causing parseMarkdownIntoBlocks to return the entire document as one block.
Updated patterns to use [\w-] to only match valid footnote identifiers
(alphanumeric, underscore, hyphen).
Added regression tests to prevent this issue from recurring.
* fix: don't treat $$ inside code blocks as math delimiters
Code blocks can contain $$ as shell syntax (e.g., pstree -p $$ for current PID).
The math block merging logic was incorrectly counting $$ inside code blocks,
causing subsequent content to be merged as if it were part of a math block.
Added tracking of previous token type to skip math merging when the previous
block was a code block.
* chore: add changeset for dollar sign fix