Codex
65059719ce
fix(discord): preserve fenced code blocks across 2000-char chunks
...
Long bot replies that exceeded Discord's 2000-char limit were split by a
naive byte-slice loop. When the split fell inside a ```fenced code block
the first chunk lost its closing fence and the next chunk lost its
opener, so Discord rendered raw backticks and the remainder as headings
or bold instead of code.
Replace the slice loop with chunkForDiscord(), a fence-aware splitter
that prefers newline boundaries, re-closes any open fence at the end of
a chunk, and reopens it (with the same language tag) at the start of the
next. Single oversize lines still fall back to a surrogate-pair-safe
byte split. Adds 10 unit tests covering the seam, multi-fence
documents, surrogate pairs, and single-line overflow.
2026-06-01 01:20:28 +09:00
..
2026-06-01 01:20:28 +09:00
2026-05-27 10:53:31 +09:00
2026-05-29 23:40:35 +09:00
2026-04-07 05:12:22 +09:00
2026-04-07 02:49:02 +09:00
2026-04-07 00:45:55 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-04-25 09:21:47 +09:00
2026-04-25 09:21:47 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-03-25 07:08:49 +09:00
2026-04-08 19:05:19 +09:00
2026-05-27 10:53:31 +09:00
2026-03-30 22:33:42 +09:00
2026-04-04 03:52:28 +09:00
2026-05-27 10:53:31 +09:00
2026-04-10 21:04:23 +09:00
2026-04-09 14:29:14 +09:00
2026-04-09 14:29:14 +09:00
2026-03-26 16:37:00 +09:00
2026-05-27 10:53:31 +09:00
2026-04-24 15:02:09 +09:00
2026-04-24 15:02:09 +09:00
2026-04-24 15:02:09 +09:00
2026-05-27 10:53:31 +09:00
2026-05-28 18:29:51 +09:00
2026-05-28 18:29:51 +09:00
2026-04-26 17:05:50 +09:00
2026-04-26 17:05:50 +09:00
2026-03-23 06:39:26 +09:00
2026-04-10 21:04:23 +09:00
2026-03-28 05:40:38 +09:00
2026-03-25 12:32:41 +09:00
2026-04-10 21:04:23 +09:00
2026-04-10 21:04:23 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-04-24 15:02:09 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-03-31 22:35:50 +09:00
2026-04-10 22:09:04 +09:00
2026-04-10 21:04:23 +09:00
2026-03-26 20:57:59 +09:00
2026-03-25 22:43:35 +09:00
2026-03-23 07:18:47 +09:00
2026-03-28 21:14:25 +09:00
2026-03-25 04:59:49 +09:00
2026-04-11 05:49:40 +09:00
2026-04-11 04:18:43 +09:00
2026-04-11 05:49:40 +09:00
2026-04-10 21:04:23 +09:00
2026-04-08 05:30:14 +09:00
2026-04-20 09:06:38 +09:00
2026-04-08 02:23:32 +09:00
2026-05-27 14:52:33 +09:00
2026-04-20 13:33:13 +09:00
2026-04-11 05:49:40 +09:00
2026-04-20 13:31:34 +09:00
2026-04-15 23:47:46 +09:00
2026-04-20 13:33:13 +09:00
2026-03-25 22:00:36 +09:00
2026-04-20 13:31:34 +09:00
2026-03-31 01:49:34 +09:00
2026-04-07 05:12:22 +09:00
2026-04-08 19:05:19 +09:00
2026-04-15 03:11:14 +09:00
2026-04-11 06:06:02 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-04-23 13:07:20 +09:00
2026-04-23 13:07:20 +09:00
2026-04-22 06:47:52 +09:00
2026-05-27 10:53:31 +09:00
2026-04-11 08:45:47 +09:00
2026-03-23 06:39:26 +09:00
2026-04-25 09:21:47 +09:00
2026-04-10 21:04:23 +09:00
2026-04-11 04:18:43 +09:00
2026-04-23 15:28:42 +09:00
2026-04-24 12:03:32 +09:00
2026-04-23 18:53:36 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-04-10 21:04:23 +09:00
2026-04-10 21:04:23 +09:00
2026-04-10 21:04:23 +09:00
2026-04-22 06:50:56 +09:00
2026-04-23 13:07:20 +09:00
2026-04-15 01:21:00 +09:00
2026-05-27 10:53:31 +09:00
2026-04-24 12:03:32 +09:00
2026-04-24 12:03:32 +09:00
2026-04-08 02:23:32 +09:00
2026-04-07 23:48:07 +09:00
2026-04-25 09:21:47 +09:00
2026-04-10 11:44:34 +09:00
2026-04-24 12:03:32 +09:00
2026-05-27 12:43:15 +09:00
2026-04-24 15:02:09 +09:00
2026-04-24 15:02:09 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 14:52:33 +09:00
2026-03-31 01:51:44 +09:00
2026-04-25 09:21:47 +09:00
2026-04-25 12:02:02 +09:00
2026-04-09 13:52:42 +09:00
2026-05-29 23:40:35 +09:00
2026-05-29 23:40:35 +09:00
2026-05-27 10:53:31 +09:00
2026-05-29 23:40:35 +09:00
2026-05-29 23:40:35 +09:00
2026-05-29 23:40:35 +09:00
2026-04-10 11:44:34 +09:00
2026-04-09 16:31:01 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-04-06 20:38:10 +09:00
2026-04-06 19:53:26 +09:00
2026-04-10 11:44:34 +09:00
2026-04-20 13:33:13 +09:00
2026-04-11 09:18:47 +09:00
2026-05-27 10:53:31 +09:00
2026-04-25 12:02:02 +09:00
2026-04-25 12:02:02 +09:00
2026-04-20 08:19:31 +09:00
2026-03-31 13:55:41 +09:00
2026-04-06 20:38:38 +09:00
2026-04-06 20:53:48 +09:00
2026-03-31 00:10:23 +09:00
2026-05-27 10:53:31 +09:00
2026-05-27 10:53:31 +09:00
2026-03-31 09:41:40 +09:00
2026-03-31 09:41:40 +09:00
2026-04-04 03:50:28 +09:00
2026-04-10 15:22:45 +09:00
2026-04-10 15:22:45 +09:00
2026-05-27 14:52:33 +09:00
2026-05-27 14:52:33 +09:00
2026-02-25 23:13:36 +02:00
2026-04-10 22:48:49 +09:00
2026-03-04 18:05:45 +02:00
2026-03-04 18:05:45 +02:00
2026-04-15 23:47:46 +09:00
2026-04-15 23:47:46 +09:00
2026-04-10 21:04:23 +09:00
2026-05-27 14:52:33 +09:00
2026-04-15 03:11:14 +09:00
2026-04-15 03:11:14 +09:00
2026-04-04 03:52:28 +09:00
2026-04-01 03:59:47 +09:00
2026-04-11 13:48:54 +09:00
2026-04-11 13:48:54 +09:00
2026-03-28 05:40:38 +09:00
2026-04-15 03:11:14 +09:00
2026-04-15 03:11:14 +09:00
2026-04-08 02:23:32 +09:00
2026-04-10 21:04:23 +09:00
2026-04-10 21:04:23 +09:00
2026-04-10 21:04:23 +09:00
2026-04-08 02:23:32 +09:00
2026-03-25 21:40:34 +09:00
2026-03-24 03:49:00 +09:00
2026-03-26 20:59:25 +09:00
2026-03-06 18:28:29 +02:00
2026-03-06 18:28:29 +02:00
2026-03-26 16:37:00 +09:00
2026-04-06 07:56:24 +09:00
2026-03-25 03:56:03 +09:00
2026-04-11 14:32:43 +09:00
2026-04-11 14:32:43 +09:00
2026-03-25 12:04:29 +09:00
2026-05-29 23:40:35 +09:00
2026-05-27 10:53:31 +09:00
2026-05-29 18:47:46 +09:00
2026-05-27 10:53:31 +09:00
2026-05-28 18:29:51 +09:00
2026-03-25 04:59:49 +09:00
2026-04-24 15:02:09 +09:00
2026-04-24 15:02:09 +09:00
2026-04-26 21:29:13 +09:00
2026-04-26 21:29:13 +09:00
2026-04-26 21:29:13 +09:00
2026-04-26 17:05:50 +09:00
2026-05-27 12:43:15 +09:00
2026-05-27 12:43:15 +09:00