LearnNewsExamplesServices
Frontmatter
id8230
titleSanitize issue titles in markdown frontmatter
stateClosed
labels
enhancementai
assigneestobiu
createdAtDec 31, 2025, 3:24 PM
updatedAtDec 31, 2025, 3:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/8230
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 31, 2025, 3:30 PM

Sanitize issue titles in markdown frontmatter

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Dec 31, 2025, 3:24 PM

As identified in the follow-up to #8229, some GitHub issue titles contain line breaks (e.g., #6941). This can break the YAML frontmatter structure, both for the main title field and when titles are included in subIssues, blockedBy, or blocking lists.

Goal: Ensure all titles used in the markdown frontmatter (main title and list items) are sanitized to be single-line strings.

Implementation:

  • Update IssueSyncer.mjs.
  • Define a regex at the top of the module to capture line breaks (/[\r\n]+/g).
  • Apply this sanitization to:
    • The main issue title.
    • The titles used in subIssues, blockedBy, and blocking lists.

Example Transformation: Original Title: "Implement Class-Aware Merging\nReplacement"

Sanitized Title: "Implement Class-Aware Merging Replacement"

tobiu added the enhancement label on Dec 31, 2025, 3:24 PM
tobiu added the ai label on Dec 31, 2025, 3:24 PM
tobiu assigned to @tobiu on Dec 31, 2025, 3:24 PM
tobiu referenced in commit b629a39 - "feat(ai): Sanitize issue titles in markdown frontmatter (#8230) on Dec 31, 2025, 3:29 PM
tobiu
tobiu Dec 31, 2025, 3:30 PM

Input from Gemini:

✦ I have implemented the requested changes in IssueSyncer.mjs.

Changes:

  • Added lineBreaksRegex constant to detect line breaks.
  • Updated #formatIssueMarkdown to sanitize the main title field in the frontmatter.
  • Updated #formatIssueMarkdown to sanitize titles within subIssues, blockedBy, and blocking lists.

Verification:

  • Verified that all title insertions into the frontmatter object now include .replace(lineBreaksRegex, ' ').

Closing this issue as the implementation is complete.

tobiu closed this issue on Dec 31, 2025, 3:30 PM
tobiu cross-referenced by #8231 on Dec 31, 2025, 3:47 PM