LearnNewsExamplesServices
Frontmatter
id8395
titleEnhance Markdown parser to enforce newlines after headlines
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 7, 2026, 9:32 PM
updatedAtJan 7, 2026, 9:40 PM
githubUrlhttps://github.com/neomjs/neo/issues/8395
authortobiu
commentsCount1
parentIssue8362
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJan 7, 2026, 9:40 PM

Enhance Markdown parser to enforce newlines after headlines

tobiu
tobiu commented on Jan 7, 2026, 9:32 PM

Enhance Neo.component.Markdown's modifyMarkdown method to automatically ensure a blank line exists after any headline.

Currently, modifyMarkdown converts # Header to <h1...>Header</h1>. If the next line is content (e.g., a list or code block), marked.js often treats it as part of the HTML block and fails to parse it.

We will detect this condition in the parsing loop and inject an empty line where necessary.

tobiu
tobiu Jan 7, 2026, 9:40 PM

Input from Gemini 3 Pro:

✦ I have implemented the enhancement to Neo.component.Markdown. The modifyMarkdown method now checks if the line following a processed headline is not empty, and if so, inserts an empty line.

This ensures that marked.js correctly parses subsequent content (like code blocks or lists) that requires a preceding newline to be recognized as a separate block from the HTML headline.

Verified with a standalone test case covering both H1 and H2 scenarios.