Skip to content

Investigate and fix frontend rendering issues for headers with numbered prefixes #353

Closed

Description

@malibio

Overview

The markdown parser (issue #350) correctly saves headers as header node type in the database, but the frontend rendering is adding unexpected line breaks for headers that contain numbered prefixes like "### 1. Maintainability".

Observed Issues

Issue 1: Headers with numbered prefixes have extra line breaks

Example: ### 1. Maintainability

  • Storage: Correctly saved as header type in database
  • Rendering: Displays with line breaks before and after the header text
  • Expected: Should render as normal header without extra spacing

Issue 2: Understanding table header bold rendering

Example: Table header row | Operation | Overhead Estimate | Notes |

  • Storage: Correctly stored as plain text node with | characters
  • Rendering: First row appears bold (GFM table detection)
  • Question: Is this intended behavior via marked.js GFM support?

Investigation Required

  1. Check base-node.svelte line 615 - markdownToHtml() processing
  2. Check marked.js GFM parser - How it handles "### 1. " pattern
  3. Check marked-config.ts lines 47-53 - Custom heading renderer
  4. Verify if GFM is detecting "1. " as ordered list within headers

Suspected Root Cause

The marked.js library with GFM enabled (marked-config.ts:57) is likely:

  • Detecting the "1. " pattern within header text
  • Creating additional HTML elements or line breaks
  • This affects headers like "### 1. Maintainability", "### 2. Testability", etc.

Files to Review

  • packages/desktop-app/src/lib/design/components/base-node.svelte:615
  • packages/desktop-app/src/lib/utils/marked-config.ts:47-57
  • packages/desktop-app/src/lib/components/markdown-renderer.svelte

Acceptance Criteria

  • Headers with numbered prefixes render without extra line breaks
  • Understand and document table header bold rendering behavior
  • Ensure marked.js GFM doesn't interfere with header text content
  • Maintain proper rendering for inline formatting (bold, italic, code)
  • Add test cases for headers with numbered prefixes

Related Issues

Priority

Low - This is a visual polish issue. The parser is working correctly and data is stored properly in the database.

Metadata

Metadata

Assignees

Labels

bugui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions