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
blockedBy[]
blocking[]
closedAtJan 7, 2026, 9:40 PM

Enhance Markdown parser to enforce newlines after headlines

Closed v11.19.0 enhancementai
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 added the enhancement label on Jan 7, 2026, 9:32 PM
tobiu added the ai label on Jan 7, 2026, 9:32 PM
tobiu added parent issue #8362 on Jan 7, 2026, 9:32 PM
tobiu assigned to @tobiu on Jan 7, 2026, 9:32 PM
tobiu referenced in commit a086381 - "enhancement: Enhance Markdown parser to enforce newlines after headlines (#8395)" on Jan 7, 2026, 9:39 PM
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.

tobiu closed this issue on Jan 7, 2026, 9:40 PM