[PR #692] [CLOSED] refactor(markdown): extract createBlockRenderable and fix margin consistency #1497

Closed
opened 2026-03-14 09:40:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/692
Author: @remorses
Created: 2/16/2026
Status: Closed

Base: mainHead: refactor/markdown-block-creation


📝 Commits (4)

  • 8e097d7 refactor(markdown): extract createBlockRenderable and fix margin consistency
  • 7cf9b47 fix: render space tokens as TextRenderable in createBlockRenderable
  • a842230 Merge branch 'main' into refactor/markdown-block-creation
  • 870bece test cover

📊 Changes

2 files changed (+60 additions, -17 deletions)

View changed files

📝 packages/core/src/renderables/Markdown.ts (+33 -17)
📝 packages/core/src/renderables/__tests__/Markdown.test.ts (+27 -0)

📄 Description

Split from #597 to make review easier.

Extracts createBlockRenderable() as a centralized dispatch for mapping token types to renderables. Extracts getBlockMarginBottom() helper. Fixes a bug where marginBottom wasn't updated on unchanged tokens in the updateBlocks fast paths.

No behavior change except the margin fix.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/692 **Author:** [@remorses](https://github.com/remorses) **Created:** 2/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/markdown-block-creation` --- ### 📝 Commits (4) - [`8e097d7`](https://github.com/anomalyco/opentui/commit/8e097d71d808fb2c8664a6556d4dcee95945d8dc) refactor(markdown): extract createBlockRenderable and fix margin consistency - [`7cf9b47`](https://github.com/anomalyco/opentui/commit/7cf9b47959b55c28e06141bfe61b6f534fe5bdb3) fix: render space tokens as TextRenderable in createBlockRenderable - [`a842230`](https://github.com/anomalyco/opentui/commit/a8422305910ba191cb0d6300fdb375eac4e40467) Merge branch 'main' into refactor/markdown-block-creation - [`870bece`](https://github.com/anomalyco/opentui/commit/870becefce1621614f2bf872d70c9416bdbae797) test cover ### 📊 Changes **2 files changed** (+60 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderables/Markdown.ts` (+33 -17) 📝 `packages/core/src/renderables/__tests__/Markdown.test.ts` (+27 -0) </details> ### 📄 Description Split from #597 to make review easier. Extracts `createBlockRenderable()` as a centralized dispatch for mapping token types to renderables. Extracts `getBlockMarginBottom()` helper. Fixes a bug where marginBottom wasn't updated on unchanged tokens in the updateBlocks fast paths. No behavior change except the margin fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:40:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1497
No description provided.