Skip to content

Fix line-start dash rendering in status content#2391

Merged
Dimillian merged 1 commit intomainfrom
codex/github-mention-bug-dash-are-replaced-by-stars
Dec 25, 2025
Merged

Fix line-start dash rendering in status content#2391
Dimillian merged 1 commit intomainfrom
codex/github-mention-bug-dash-are-replaced-by-stars

Conversation

@Dimillian
Copy link
Owner

@Dimillian Dimillian commented Dec 25, 2025

Motivation

  • Status content that begins lines with - , * or + was being interpreted as Markdown list markers and rendered as list items instead of literal text.
  • The HTML-to-markdown conversion in HTMLString must preserve literal leading list markers when they appear at the start of a line in the original content.

Description

  • Update Packages/Models/Sources/Models/Alias/HTMLString.swift to detect line starts when handling #text nodes and escape leading list markers by prefixing them with a backslash so they render as literal characters.
  • The check treats a line start as when asMarkdown is empty or ends with a newline and escapes markers matching - , * or + .
  • Add a regression test testHTMLStringInit_lineStartListMarkers in Packages/Models/Tests/ModelsTests/HTMLStringTests.swift that verifies a <br />- sequence is preserved as \- in asMarkdown.

Testing

  • Added unit test testHTMLStringInit_lineStartListMarkers to cover the regression scenario and ensure literal leading markers are escaped.
  • No automated test suite was executed in this environment (xcodebuild / swift test not run here).

Codex Task


Note

Prevents accidental list rendering when status text starts with list-like markers.

  • Update HTMLString.handleNode(#text) to detect line starts (empty output or after \n) and prefix leading - , * , + with a backslash before appending to asMarkdown
  • Add testHTMLStringInit_lineStartListMarkers verifying <br />- becomes \- in asMarkdown while asRawText remains unchanged

Written by Cursor Bugbot for commit fb30f7a. This will update automatically on new commits. Configure here.

@Dimillian Dimillian merged commit 84d7eb2 into main Dec 25, 2025
5 checks passed
rrgeorge pushed a commit to rrgeorge/IceCubesApp that referenced this pull request Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments