Repository navigation
Investigate and fix frontend rendering issues for headers with numbered prefixes - #354
Merged
Merged
Conversation
## Problem
Headers with numbered prefixes like "### 1. Maintainability" were being
rendered as HTML ordered lists (`<ol><li>Maintainability</li></ol>`)
instead of plain text "1. Maintainability".
## Root Cause
- marked.js with GFM enabled was detecting the "1. " pattern as an
ordered list, even within header node content
- This caused extra line breaks and incorrect HTML structure
## Solution
Added custom `list()` renderer to marked-config.ts that:
- Disables HTML list generation (`<ol>`, `<ul>` tags)
- Preserves list markers as plain text ("1. ", "2. ", "- ")
- Maintains the original text formatting
## Testing
- Verified in browser that "### 1. Maintainability" now renders as
"1. Maintainability" (plain text) instead of `<ol><li>` HTML
- Confirmed no `<ol>` or `<li>` tags in DOM
## Documentation
- Updated marked-config.ts header comments to document:
- List rendering behavior
- GFM table header bold rendering (intended behavior)
Fixes #353
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
- Set min-height to 1.5rem (24px) for both textarea and empty view divs - This matches the line-height:1.5 that makes textarea naturally 24px tall - Previously: textarea was 24px, empty view div was 20px (4px difference) - Now: both are 24px, preventing nodes below from shifting on edit/view toggle 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add codespan renderer to marked-config.ts for backtick syntax - Style inline code to match code blocks (muted bg, padding, monospace font) - Inline code uses <code class="markdown-code-inline"> element - Example: `code` renders with same visual style as code-block nodes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
## Changes ### 1. Add Regression Tests (Critical - Addresses #353 Acceptance Criteria) - Add comprehensive test suite for list rendering behavior - Test that "1. Text" remains plain text (not converted to <ol>) - Test headers with numbered prefixes (#353 specific case) - Test unordered lists, task lists, and various number formats - Add tests for inline code rendering - All 20 tests in marked-config.test.ts pass ### 2. Architectural Documentation (Important) - Document why list renderer disables HTML list generation globally - Explain NodeSpace's semantic node type architecture - Note future consideration for conditional list rendering - Clarify relationship with /ordered-list slash command ### 3. Enhanced GFM Documentation (Nice-to-have) - Explain why GFM is enabled despite semantic node types - Document trade-offs and design decisions - Reference Issue #350 for context on marked.js adoption ### 4. Improved Code Comments (Nice-to-have) - Clarify recursive parsing of list item tokens - Explain preservation of markers as plain text vs <li> tags ### 5. CSS Consolidation Documentation (Nice-to-have) - Document .markdown-code as legacy from markdown-utils.ts - Add TODO for future consolidation with .markdown-code-inline - Prevent confusion about duplicate styling ## Testing - marked-config.test.ts: 20/20 tests pass - Quality checks: 0 errors, 0 warnings - All acceptance criteria for #353 now met 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This was referenced Jul 22, 2026
6 of 11 tasks
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.
Closes #353