mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[PR #784] fix(markdown): harden code block fallback and info parsing #1558
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1558
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/784
Author: @ryanfreckleton
Created: 3/6/2026
Status: 🔄 Open
Base:
main← Head:fix-markdown-codeblock-style-clean📝 Commits (3)
e84f8e5fix(markdown): harden code block fallback and info parsingb30915fMerge branch 'main' into fix-markdown-codeblock-style-clean076cc56Merge branch 'main' into fix-markdown-codeblock-style-clean📊 Changes
4 files changed (+373 additions, -7 deletions)
View changed files
📝
packages/core/src/renderables/Code.test.ts(+63 -0)📝
packages/core/src/renderables/Code.ts(+57 -5)📝
packages/core/src/renderables/Markdown.ts(+73 -2)📝
packages/core/src/renderables/__tests__/Markdown.test.ts(+180 -0)📄 Description
Downstream: OpenCode
In OpenCode, fenced code blocks with unknown/unsupported languages are illegible on light terminal themes (for example, Solarized Light) because fallback plain-text rendering had no guaranteed base fg/bg.
Why here
CodeRenderable, notMarkdownRenderable, so all call sites (markdown and standalone) inherit safe defaults.Scope
CodeRenderablenow derives baselinefg/bg/attributesfromsyntaxStyle["default"]when those props are omitted (and reapplies onsyntaxStylechange without overriding explicit caller values).MarkdownRenderablenow normalizes fence language info asfirst token + lowercase + extToFiletype alias mapping(for example,BASH title=...->shell,ToMl->toml).Validation
~/src/opencode-opentui-test) that unknown-language fences remain readable on light themes.bun test packages/core/src/renderables/Code.test.ts packages/core/src/renderables/__tests__/Markdown.test.ts🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.