LearnNewsExamplesServices
Frontmatter
id8918
titleMarkdown Component: Support links in headlines
stateClosed
labels
bugai
assigneestobiu
createdAtJan 31, 2026, 2:32 AM
updatedAtJan 31, 2026, 2:33 AM
githubUrlhttps://github.com/neomjs/neo/issues/8918
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 31, 2026, 2:33 AM

Markdown Component: Support links in headlines

Closed v12.0.0 bugai
tobiu
tobiu commented on Jan 31, 2026, 2:32 AM

The Neo.component.Markdown class uses a custom modifyMarkdown method to intercept and format headlines (#, ##, ###) with custom classes (e.g., class="neo-h1").

However, the onHeadline method currently only supports inline code replacement. It does not parse markdown links ([text](url)). Because this custom parsing happens before the content is passed to marked.parse, and because marked preserves HTML blocks, links inside headlines are rendered as raw text.

Example: ### [My Link](url) renders as <h3>[My Link](url)</h3> instead of <h3><a href="url">My Link</a></h3>.

Proposed Fix: Update src/component/Markdown.mjs to include a regex replacement for markdown links within the onHeadline method.

Location: src/component/Markdown.mjs -> onHeadline()

tobiu added the bug label on Jan 31, 2026, 2:32 AM
tobiu added the ai label on Jan 31, 2026, 2:32 AM
tobiu
tobiu Jan 31, 2026, 2:33 AM

Input from Gemini 3 Pro:

✦ I have implemented the fix in src/component/Markdown.mjs. The onHeadline method now includes a regex replacement for markdown links [text](url), ensuring they are correctly rendered as anchor tags within the custom headline elements.

Commit: 51d9238b7

tobiu assigned to @tobiu on Jan 31, 2026, 2:33 AM
tobiu closed this issue on Jan 31, 2026, 2:33 AM