LearnNewsExamplesServices
Frontmatter
id8396
titleEnhance Markdown parser to support implicit readonly code blocks
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 7, 2026, 9:46 PM
updatedAtJan 7, 2026, 9:55 PM
githubUrlhttps://github.com/neomjs/neo/issues/8396
authortobiu
commentsCount1
parentIssue8362
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 7, 2026, 9:55 PM

Enhance Markdown parser to support implicit readonly code blocks

Closed v11.19.0 enhancementai
tobiu
tobiu commented on Jan 7, 2026, 9:46 PM

Update Neo.component.Markdown to treat all code blocks as readonly by default, removing the requirement for the explicit readonly flag.

  1. Parsing Order: live-preview, neo-component, and mermaid blocks are already parsed first and replaced with placeholders.
  2. Generic Fallback: The parser will then match any remaining triple-backtick code blocks.
  3. Implicit Readonly: These blocks will be processed as readonly code blocks with syntax highlighting.
  4. Default Language: If no language is specified (e.g. just ```), it will default to plaintext.

This simplifies writing markdown for the portal and release notes.

tobiu added the enhancement label on Jan 7, 2026, 9:46 PM
tobiu added the ai label on Jan 7, 2026, 9:46 PM
tobiu added parent issue #8362 on Jan 7, 2026, 9:46 PM
tobiu assigned to @tobiu on Jan 7, 2026, 9:46 PM
tobiu referenced in commit 2b1416f - "enhancement: Enhance Markdown parser to support implicit readonly code blocks (#8396)" on Jan 7, 2026, 9:54 PM
tobiu
tobiu Jan 7, 2026, 9:54 PM

Input from Gemini 3 Pro:

✦ I have enhanced Neo.component.Markdown to support implicit readonly code blocks.

Changes:

  1. Generic Regex: Replaced the restricted regexReadonly with a generic regexCodeBlock that matches any triple-backtick block.
  2. Implicit Readonly: All code blocks are now processed as readonly blocks by default (after live-preview and other special blocks are extracted).
  3. Smart Defaults: If a language is not specified (e.g. ```) or is text, it defaults to plaintext.
  4. Robust Error Handling: The parser now catches errors from HighlightJS (e.g., if an unknown language is specified like ```java) and automatically falls back to plaintext highlighting, preventing parser crashes.

This simplifies writing markdown for the Portal and Release Notes, as readonly flags are no longer required.

tobiu closed this issue on Jan 7, 2026, 9:55 PM
tobiu referenced in commit 31cc663 - "feat: Enhance Markdown parser (implicit readonly, ticket linking) (#8396, #8397)" on Jan 7, 2026, 11:11 PM