feat: Updated variant of gignit's Markdown renderer feature.#204
Open
ariane-emory wants to merge 8 commits intodevfrom
Open
feat: Updated variant of gignit's Markdown renderer feature.#204ariane-emory wants to merge 8 commits intodevfrom
ariane-emory wants to merge 8 commits intodevfrom
Conversation
…yntax highlighting Custom markdown renderer that works alongside upstream's experimental markdown flag: - When OPENCODE_EXPERIMENTAL_MARKDOWN is ON: uses upstream's <markdown> element - When OFF (default): uses custom hybrid renderer with Prose/CodeBlock components Features: - Box-drawing table rendering with cell word wrap and unicode-aware widths - Tree-sitter syntax highlighting for code blocks via native <code> element - Task list checkbox rendering - Strikethrough support - Header background panels for h1/h2 - Diff code block coloring (+/- lines) - CLI markdown rendering via UI.markdown() with theme support - Theme loader supporting all 33 upstream themes
Adds control panel option to render markdown in user messages: - Default: agent messages only (existing behavior) - Toggle: Ctrl+P -> Render markdown: all messages - Persisted via KV store (markdown_all_messages) - Respects OPENCODE_EXPERIMENTAL_MARKDOWN flag
…bles Inline markdown (backticks, links, strikethrough) nested inside bold or italic markers was rendered as raw text. For example, table cells like **HTTP `/tools/list`** would show literal backticks instead of styled code spans. Replace hardcoded single-nesting checks (bold-inside-italic, italic-inside-bold) with recursive renderInlineThemedWithDefault calls that process all inline markdown within bold/italic/bold-italic content. Recursive calls inherit parent attrs via bitwise OR to preserve combined styling (e.g. italic inside bold retains bold+italic). Also update table header rendering to use renderCell with inline markdown processing instead of dumping raw text as a single bold chunk. Additional fixes identified via code review: - Add truncation in renderCell when rendered content exceeds column width, preventing table border misalignment on narrow terminals - Propagate defaultAttrs to inline code, links, and strikethrough so they inherit outer bold/italic styling when nested
The 'Render markdown: all messages' toggle was under the Session category in the command palette. Move it to the System category alongside other app-wide toggles (animations, diff wrapping) since markdown rendering preference is a global setting, not session-specific.
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.
Type of change
What does this PR do?
This is largely a duplicate of the branch in the PR at https://github.com/gignit/opencode/pull/1, but updated with the latest changes from
anomalyco/dev, providing beautiful rendering for Markdown elements such as tables, boldfaces, italic faces, list elements, and other Markdown items. The rendering may be applied either only to agent messages or also to user messages (including the output of custom slash commands), toggleable using an item in the command palette.