feat(markdown): Editor component optimization — maxLength, toolbar config, streaming, code block actions#1
Merged
CoderBoyBoy merged 6 commits intomainfrom Mar 19, 2026
Conversation
Co-authored-by: CoderBoyBoy <11583532+CoderBoyBoy@users.noreply.github.com>
- Task 1: Add maxLength prop with character counter - Task 2: Fix code vs codeblock toolbar actions (inline vs block) - Task 3: Support flexible toolbar config (boolean | array | object) - Task 4: Add SSE streaming support with cursor animation and auto-scroll - Task 5: Add code block download & HTML preview buttons Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lbar config, streaming, code block actions Co-authored-by: CoderBoyBoy <11583532+CoderBoyBoy@users.noreply.github.com>
…ng demo, and code examples Co-authored-by: CoderBoyBoy <11583532+CoderBoyBoy@users.noreply.github.com>
…x comment, cursor position on truncation Co-authored-by: CoderBoyBoy <11583532+CoderBoyBoy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize Markdown editor component
feat(markdown): Editor component optimization — maxLength, toolbar config, streaming, code block actions
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five enhancements to the Markdown editor/renderer components: character limits, toolbar flexibility, SSE streaming support, toolbar icon fixes, and code block action buttons.
Changes
maxLengthprop — Truncates input at limit, preserves cursor position, renders128 / 500counter below editor when setcode/codeblockfix —codeaction now inserts`text`(was incorrectly inserting fenced blocks).codeblockgets a distinct SVG icon (rectangle with lines) vs text</>for inline codetoolbarprop union type — Acceptsfalse(hide),ToolbarItem[](whitelist), or legacy{ show, items }object. Normalized internally vianormalizeToolbarConfig()streamingprop bypasses debounce, appends blinking cursor via::afterpseudo-element, auto-scrolls when near bottom.onStreamEndfires onstreaming: true → falsetransition.code-block-actionscontainer. Download mapsdata-language→ file extension viaLANG_EXT_MAP. Preview (HTML only) renders insandbox="allow-scripts"iframe modal (noallow-same-origin)download,preview,closePreviewstrings for both localesUsage
Types
All new props are optional with backward-compatible defaults. Existing tests unaffected (3 pre-existing failures unchanged).
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.