LearnNewsExamplesServices
Frontmatter
id8067
titleCreate Neo.component.Markdown for Encapsulated Markdown Rendering
stateClosed
labels
enhancementairefactoringarchitecture
assigneestobiu
createdAtDec 9, 2025, 1:29 PM
updatedAtDec 9, 2025, 2:55 PM
githubUrlhttps://github.com/neomjs/neo/issues/8067
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 9, 2025, 2:55 PM

Create Neo.component.Markdown for Encapsulated Markdown Rendering

Closed v11.17.0 enhancementairefactoringarchitecture
tobiu
tobiu commented on Dec 9, 2025, 1:29 PM

Implement a dedicated Neo.component.Markdown component to encapsulate Markdown rendering logic and styling, promoting reuse and consistency across LivePreview and ContentComponent.

Scope:

  1. Create src/component/Markdown.mjs:

    • Config: ntype: 'markdown', reactive value_ (markdown string).
    • Logic: Uses MarkdownRenderer internally. When value changes, delegates rendering to the renderer.
    • Lifecycle: Delegates destroy() to renderer.destroyComponents().
    • Styling: Move styles from ContentComponent.scss to a new src/component/Markdown.scss (or similar shared location) and apply them here.
  2. Refactor LivePreview.mjs:

    • When language is 'markdown', instantiate Neo.component.Markdown inside the preview container instead of using the renderer directly on the container.
    • Bind the editor value to the markdown component's value.
  3. Refactor ContentComponent.mjs:

    • Extend Neo.component.Markdown instead of Neo.component.Base.
    • Inherit the rendering and styling logic.
    • Retain specific Portal logic (fetching, routing, intersection observer).

Goal: Decouple styling from the view and logic from the renderer, creating a self-contained Markdown component that can be used anywhere (e.g., LivePreview, Dashboards).

Note: This ticket focuses on the component creation and integration. Consolidating logic from MarkdownRenderer into the component itself is out of scope for this task and will be considered later.

tobiu added the enhancement label on Dec 9, 2025, 1:29 PM
tobiu added the ai label on Dec 9, 2025, 1:29 PM
tobiu added the refactoring label on Dec 9, 2025, 1:29 PM
tobiu added the architecture label on Dec 9, 2025, 1:29 PM
tobiu assigned to @tobiu on Dec 9, 2025, 1:29 PM
tobiu referenced in commit 6026b5c - "Create Neo.component.Markdown for Encapsulated Markdown Rendering #8067" on Dec 9, 2025, 2:35 PM
tobiu closed this issue on Dec 9, 2025, 2:55 PM