openclaw/src/markdown
Sid 2e84017f23
fix(markdown): require paired || delimiters for spoiler detection (#26105)
* fix(markdown): require paired || delimiters for spoiler detection

An unpaired || (odd count across all inline tokens) would open a
spoiler that never closes, causing closeRemainingStyles to extend it
to the end of the text. This made all content after an unpaired ||
appear as hidden/spoiler in Telegram.

Pre-count || delimiters across the entire inline token group and skip
spoiler injection entirely when the count is less than 2 or odd. This
prevents single | characters and unpaired || from triggering spoiler
formatting.

Closes #26068

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: preserve valid spoiler pairs with trailing unmatched delimiters (#26105) (thanks @Sid-Qin)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-02-25 04:54:51 +00:00
..
code-spans.ts test: add command arg parsing coverage (#936) (thanks @thewilloftheshadow) 2026-01-15 09:38:21 +00:00
fences.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
frontmatter.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
frontmatter.ts fix(security): use YAML core schema to prevent type coercion (#20857) 2026-02-19 03:15:36 -08:00
ir.blockquote-spacing.test.ts fix(signal): outbound formatting and markdown IR rendering improvements (#9781) 2026-02-14 16:57:20 +01:00
ir.hr-spacing.test.ts test: remove duplicate hr spacing assertion 2026-02-16 06:16:33 +00:00
ir.nested-lists.test.ts perf(test): fold markdown list spacing into nested lists suite 2026-02-16 02:45:00 +00:00
ir.table-bullets.test.ts fix: add per-channel markdown table conversion (#1495) (thanks @odysseus0) 2026-01-23 18:39:25 +00:00
ir.table-code.test.ts fix(signal): outbound formatting and markdown IR rendering improvements (#9781) 2026-02-14 16:57:20 +01:00
ir.ts fix(markdown): require paired || delimiters for spoiler detection (#26105) 2026-02-25 04:54:51 +00:00
render.ts feat(telegram): render blockquotes as native <blockquote> tags (#14608) (#14626) 2026-02-12 08:11:57 -05:00
tables.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
whatsapp.test.ts test: dedupe channel and transport adapters 2026-02-21 21:44:01 +00:00
whatsapp.ts fix(whatsapp): convert Markdown bold/strikethrough to WhatsApp formatting (#14285) 2026-02-11 23:09:02 -06:00