You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gpt-pilot/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>
9 months ago
..
code-spans.ts test: add command arg parsing coverage (#936) (thanks @thewilloftheshadow) 10 months ago
fences.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 10 months ago
frontmatter.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 10 months ago
frontmatter.ts fix(security): use YAML core schema to prevent type coercion (#20857) 9 months ago
ir.blockquote-spacing.test.ts fix(signal): outbound formatting and markdown IR rendering improvements (#9781) 9 months ago
ir.hr-spacing.test.ts test: remove duplicate hr spacing assertion 9 months ago
ir.nested-lists.test.ts perf(test): fold markdown list spacing into nested lists suite 9 months ago
ir.table-bullets.test.ts fix: add per-channel markdown table conversion (#1495) (thanks @odysseus0) 10 months ago
ir.table-code.test.ts fix(signal): outbound formatting and markdown IR rendering improvements (#9781) 9 months ago
ir.ts fix(markdown): require paired || delimiters for spoiler detection (#26105) 9 months ago
render.ts feat(telegram): render blockquotes as native <blockquote> tags (#14608) (#14626) 9 months ago
tables.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 10 months ago
whatsapp.test.ts test: dedupe channel and transport adapters 9 months ago
whatsapp.ts fix(whatsapp): convert Markdown bold/strikethrough to WhatsApp formatting (#14285) 9 months ago