nesquena-hermes
f6ea11d22e
fix(renderer): group consecutive blockquote lines into single element
...
Root cause: the old rule `s.replace(/^> (.+)$/gm, ...)` had three bugs:
1. `.+` required at least one character — bare `>` lines (blank
continuation lines) did not match and passed through as literal `>`
2. Each matching line became its own `<blockquote>` element — a 10-line
blockquote produced 10 stacked `<blockquote>` tags with no grouping
3. When a fenced code block sat inside a blockquote, the fence-stash
pass consumed the code content and left orphaned `>` lines that the
old `.+` pattern could not match
Fix: replace the single-line regex with a group-based approach that matches
one or more consecutive `>` lines as a single block, strips the `>` prefix
from each line, passes each non-empty line through inlineMd(), turns blank
`>` lines into `<br>`, and wraps the entire group in one `<blockquote>`.
14 regression tests added covering:
- Single-line blockquotes (regression)
- Multi-line grouping (2 and 10 lines)
- Two separate blockquotes staying separate
- Bare `>` and `>text` (no space) edge cases
- Blank continuation lines → <br>
- Bold / italic / inline-code inside blockquotes
- Blockquote followed by normal paragraph
2026-04-26 02:44:34 +00:00
..
2026-03-30 20:40:19 -07:00
2026-04-21 02:25:14 +00:00
2026-04-21 00:33:03 +00:00
2026-04-20 00:04:27 -07:00
2026-04-25 14:33:41 -07:00
2026-04-23 12:15:56 -07:00
2026-04-25 15:47:44 -07:00
2026-04-25 15:47:44 -07:00
2026-04-25 15:47:44 -07:00
2026-04-25 17:50:58 -07:00
2026-04-25 17:50:58 -07:00
2026-04-25 19:21:00 -07:00
2026-04-15 19:16:14 +00:00
2026-04-14 19:04:48 +00:00
2026-04-25 17:50:58 -07:00
2026-04-09 18:05:23 -07:00
2026-04-24 01:32:47 +00:00
2026-04-24 09:05:25 -07:00
2026-04-26 02:44:34 +00:00
2026-04-20 20:55:53 -07:00
2026-04-25 14:33:41 -07:00
2026-04-23 09:58:15 -07:00
2026-04-20 23:54:40 +00:00
2026-04-25 17:50:58 -07:00
2026-04-15 13:10:50 +08:00
2026-04-21 22:55:09 -07:00
2026-04-19 05:37:44 +00:00
2026-04-22 20:18:02 +00:00
2026-04-24 09:05:25 -07:00
2026-04-25 15:47:44 -07:00
2026-04-21 17:41:05 -07:00
2026-04-16 18:09:16 -07:00
2026-04-21 23:39:39 -07:00
2026-04-25 13:07:35 -07:00
2026-04-15 23:21:56 +08:00
2026-04-18 06:37:09 +00:00
2026-04-14 21:13:33 +00:00
2026-04-13 11:40:15 -07:00
2026-04-20 21:03:41 -07:00
2026-04-24 11:41:17 -07:00
2026-04-14 21:14:00 +00:00
2026-04-14 21:14:33 +00:00
2026-04-14 21:52:34 +00:00
2026-04-16 00:00:22 +00:00
2026-04-20 19:43:40 +00:00
2026-04-16 20:16:07 -07:00
2026-04-25 15:47:44 -07:00
2026-04-25 14:33:41 -07:00
2026-04-18 06:45:39 +00:00
2026-04-16 18:09:16 -07:00
2026-04-24 09:05:25 -07:00
2026-04-21 15:26:52 -07:00
2026-04-25 13:07:35 -07:00
2026-04-25 14:33:41 -07:00
2026-04-18 06:46:43 +00:00
2026-04-20 23:04:09 +00:00
2026-04-20 19:43:40 +00:00
2026-04-18 17:09:59 +00:00
2026-04-20 22:48:19 +00:00
2026-04-19 23:11:49 -07:00
2026-04-23 14:25:43 -07:00
2026-04-21 00:58:02 +00:00
2026-04-21 17:08:52 +00:00
2026-04-23 09:05:57 -07:00
2026-04-22 16:27:01 +00:00
2026-04-21 23:08:24 -07:00
2026-04-22 20:21:42 +00:00
2026-04-23 09:58:15 -07:00
2026-04-23 09:05:57 -07:00
2026-04-25 13:07:35 -07:00
2026-04-23 09:05:57 -07:00
2026-04-23 11:16:59 -07:00
2026-04-23 10:44:10 -07:00
2026-04-25 13:07:35 -07:00
2026-04-14 17:13:03 +00:00
2026-04-20 22:48:19 +00:00
2026-04-22 20:20:01 +00:00
2026-04-23 14:41:06 -07:00
2026-04-14 17:14:01 +00:00
2026-04-19 06:47:24 +00:00
2026-04-16 11:20:08 -07:00
2026-04-21 17:41:05 -07:00
2026-04-14 17:13:03 +00:00
2026-04-21 17:49:10 -07:00
2026-04-22 22:56:21 -07:00
2026-04-22 20:18:02 +00:00
2026-04-23 15:46:02 -07:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-16 11:20:08 -07:00
2026-04-21 17:41:05 -07:00
2026-04-15 16:57:31 +00:00
2026-04-21 19:14:31 -07:00
2026-04-23 02:09:37 +00:00
2026-04-23 02:09:37 +00:00
2026-04-23 02:09:37 +00:00
2026-04-22 16:26:48 +00:00
2026-04-24 10:44:46 -07:00
2026-04-23 15:14:21 -07:00
2026-04-21 16:26:51 +00:00
2026-04-25 19:21:00 -07:00
2026-04-23 23:25:45 -07:00
2026-04-21 15:26:52 -07:00
2026-04-24 12:33:56 -07:00
2026-04-25 17:50:58 -07:00
2026-04-14 19:04:48 +00:00
2026-04-25 13:07:35 -07:00
2026-04-25 13:07:35 -07:00
2026-04-19 05:37:44 +00:00
2026-04-21 22:11:32 -07:00
2026-04-25 17:50:58 -07:00
2026-04-14 19:04:48 +00:00
2026-04-24 09:05:25 -07:00
2026-04-11 20:06:37 -07:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-24 13:04:36 -07:00
2026-04-14 19:04:48 +00:00
2026-04-23 02:35:58 +00:00
2026-04-24 09:05:25 -07:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-16 11:20:08 -07:00
2026-04-24 09:05:25 -07:00
2026-04-18 06:46:43 +00:00
2026-04-23 10:44:10 -07:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-18 06:37:09 +00:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-18 06:37:09 +00:00
2026-04-18 06:37:09 +00:00
2026-04-14 19:04:48 +00:00
2026-04-18 06:37:09 +00:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-15 13:10:50 +08:00
2026-04-14 19:04:48 +00:00
2026-04-22 20:49:28 +00:00
2026-04-11 12:19:12 -07:00
2026-04-24 09:05:25 -07:00
2026-04-12 10:51:48 -07:00
2026-04-22 22:17:40 -07:00
2026-04-16 14:04:42 -07:00
2026-04-18 06:45:39 +00:00
2026-04-16 10:19:10 -07:00
2026-04-22 16:27:01 +00:00
2026-04-12 14:28:16 -07:00
2026-04-23 14:25:43 -07:00
2026-04-20 23:23:19 +00:00
2026-04-13 11:11:56 -07:00
2026-04-13 23:25:26 -07:00
2026-04-14 19:04:48 +00:00
2026-04-19 04:29:07 +00:00
2026-04-19 05:37:44 +00:00
2026-04-24 11:04:16 -07:00
2026-04-20 00:53:19 -07:00
2026-04-19 23:17:00 -07:00
2026-04-20 23:54:40 +00:00
2026-04-24 11:04:32 -07:00
2026-04-21 18:47:40 -07:00
2026-04-25 13:07:35 -07:00
2026-04-23 09:45:34 -07:00
2026-04-09 18:08:29 -07:00
2026-04-16 14:04:42 -07:00
2026-04-21 00:33:03 +00:00
2026-04-20 01:12:45 -07:00
2026-04-25 14:33:41 -07:00
2026-04-10 10:02:28 -07:00
2026-04-12 00:19:33 -07:00
2026-04-20 20:36:53 -07:00
2026-04-13 22:11:45 -07:00
2026-04-24 11:03:42 -07:00
2026-04-21 18:47:40 -07:00