Repository navigation
Commit 57012bb
committed
fix(zalouser): normalize CRLF + include + list markers in collapse rules
Two polish findings from the third upstream review pass on #85039:
P2 (confidence 0.88) - normalizeZalouserOutboundText split only on \n, so
Windows-style agent output (`---\r\n`, `- a\r\n\r\n- b`) kept a trailing
\r on each line. The $-anchored, [ \t]-only HR / list / fence matchers
then failed to fire and the broken spacing / literal HR reached Zalo.
Fix: normalize \r\n? -> \n up front, mirroring the markdown style parser
in text-styles.ts. Covers CRLF and lone-CR (old-mac) endings.
P3 (confidence 0.82) - the zalouser markdown parser treats `+ item` as an
unordered list, but the blank-line collapse regexes only matched `-`,
`*`, and numbered items. A `+` list separated by blank lines still
rendered fragmented. Fix: add `+` to the shared list-item character
class in all three patterns, and extend the `after` negative lookahead
to exclude `*`/`+` so list-to-list gaps stay with the `between` rule.
Tests: 6 new outbound-format.test.ts cases (CRLF bullets, CR-terminated
HR, lone-CR; `+` bullets, mixed -/*/+/numbered, prose-to-+-list).
Full zalouser suite: 194 passed, 2 skipped.1 parent f368bcf commit 57012bb
2 files changed
Lines changed: 52 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
199 | 233 | | |
200 | 234 | | |
201 | 235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
69 | | - | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
139 | 146 | | |
140 | 147 | | |
141 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
142 | 153 | | |
143 | | - | |
144 | | - | |
145 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
146 | 160 | | |
147 | 161 | | |
148 | 162 | | |
| |||
0 commit comments