fix(status): banner Details strips Markdown syntax, not every #, _, >, * (#308) #390

Merged
jared merged 1 commits from fix/kuma-plain-text into lotus 2026-10-18 01:33:18 -04:00
Owner

Fixes #308.

plain() (the status banner's Details text) ran .replace(/[*_\#>]/g, '')`, which deleted those characters everywhere:

  • "join #lotus-general" → "join lotus-general"
  • snake_case, @some_user, "C#" lost characters
  • "calls -> fixed" → "calls - fixed", "5 * 3" → "5 3"
  • <b>guide</b> → "<bguide</b"

Change: only Markdown syntax is stripped:

  • heading, quote and list markers at the start of a line;
  • paired **x**, *x*, _x_, `x`;
  • HTML tags.

Images are dropped and links become their text, as before.

Unit cases (from the issue): #room:server, snake_case, @some_user, C#, ->, > 5, 5 * 3, a heading plus list plus quote, emphasis and code, and the issue's HTML example. The existing maintenance/announcement tests are unchanged and pass.

tsc clean · ESLint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #308. `plain()` (the status banner's Details text) ran `.replace(/[*_\`#>]/g, '')`, which deleted those characters **everywhere**: - "join #lotus-general" → "join lotus-general" - `snake_case`, `@some_user`, "C#" lost characters - "calls -> fixed" → "calls - fixed", "5 * 3" → "5 3" - `<b>guide</b>` → "<bguide</b" **Change:** only Markdown syntax is stripped: - heading, quote and list markers at the start of a line; - paired `**x**`, `*x*`, `_x_`, `` `x` ``; - HTML tags. Images are dropped and links become their text, as before. **Unit cases** (from the issue): `#room:server`, `snake_case`, `@some_user`, `C#`, `->`, `> 5`, `5 * 3`, a heading plus list plus quote, emphasis and code, and the issue's HTML example. The existing maintenance/announcement tests are unchanged and pass. `tsc` clean · ESLint clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-17 20:22:16 -04:00
fix(status): banner Details strips Markdown syntax, not every #, _, >, * (#308)
CI / Build & Quality Checks (pull_request) Successful in 3m20s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 13s
CI / Playwright smoke (e2e) (pull_request) Successful in 17m3s
f30a65eb74
plain() deleted those characters everywhere, so "join #lotus-general"
lost its #, snake_case and @some_user lost underscores, "->" became
"-", "5 * 3" became "5  3", and "<b>" became "<b". Strip only syntax:
heading / quote / list markers at line start, paired **x** *x* _x_ `x`,
and HTML tags.

Fixes #308

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit c87fa4f6d5 into lotus 2026-10-18 01:33:18 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#390