Skip to content

Comments

feat: Updated variant of gignit's Markdown renderer feature.#204

Open
ariane-emory wants to merge 8 commits intodevfrom
feat/gignit--markdown-render
Open

feat: Updated variant of gignit's Markdown renderer feature.#204
ariane-emory wants to merge 8 commits intodevfrom
feat/gignit--markdown-render

Conversation

@ariane-emory
Copy link
Owner

@ariane-emory ariane-emory commented Feb 20, 2026

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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.

ryanwyler and others added 8 commits February 6, 2026 23:33
…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.
@ariane-emory ariane-emory changed the title Feat/gignit markdown render feat: Updated variant of gignit's Markdown renderer feature. Feb 22, 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.

2 participants