Commit bc87d07
committed
refactor: replace regex-based stripMarkdownInline with render-then-strip-ANSI
Eliminate the entire stripMarkdownInline() function and its accumulated
edge-case bugs (code span precedence, underscore corruption, backslash
escapes). Instead, reuse the existing marked.lexer() → renderInline()
pipeline for both TTY and plain modes, stripping ANSI from the result
in plain mode — the same approach renderMarkdown() already uses.
Key changes:
- renderInlineMarkdown(): always renders through marked, strips ANSI in
plain mode instead of calling stripMarkdownInline()
- renderCodespan(): extracted helper; skips padding spaces in plain mode
so table column widths aren't inflated
- formatTable/formatTraceTable/formatLogTable: merged TTY and plain
branches into a single renderInlineMarkdown() call
- mdRow(): same — single code path for both modes
- Deleted stripMarkdownInline() entirely1 parent 2a5c827 commit bc87d07
File tree
5 files changed
+37
-93
lines changed- src/lib/formatters
- test/commands/project
5 files changed
+37
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
| |||
175 | 173 | | |
176 | 174 | | |
177 | 175 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | 176 | | |
189 | 177 | | |
190 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
105 | 100 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 101 | + | |
110 | 102 | | |
111 | 103 | | |
112 | 104 | | |
| |||
216 | 208 | | |
217 | 209 | | |
218 | 210 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | 211 | | |
246 | 212 | | |
247 | 213 | | |
| |||
296 | 262 | | |
297 | 263 | | |
298 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
299 | 278 | | |
300 | 279 | | |
301 | 280 | | |
| 281 | + | |
302 | 282 | | |
303 | 283 | | |
304 | 284 | | |
305 | 285 | | |
306 | 286 | | |
307 | 287 | | |
308 | 288 | | |
309 | | - | |
310 | | - | |
311 | | - | |
| 289 | + | |
312 | 290 | | |
313 | 291 | | |
314 | 292 | | |
| |||
584 | 562 | | |
585 | 563 | | |
586 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
587 | 570 | | |
588 | | - | |
| 571 | + | |
589 | 572 | | |
590 | 573 | | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | 574 | | |
595 | | - | |
| 575 | + | |
| 576 | + | |
596 | 577 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 110 | | |
129 | 111 | | |
130 | 112 | | |
| |||
134 | 116 | | |
135 | 117 | | |
136 | 118 | | |
137 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
138 | 123 | | |
139 | 124 | | |
140 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 126 | | |
137 | 127 | | |
138 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
494 | | - | |
495 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| |||
0 commit comments