* Apply default text style to a string. * This is the base styling applied to all text content. * NOTE: Background color is NOT applied here - it's applied at the padding stage * to ensure it extends to the full line width.
(text: string)
| 248 | * to ensure it extends to the full line width. |
| 249 | */ |
| 250 | private applyDefaultStyle(text: string): string { |
| 251 | if (!this.defaultTextStyle) { |
| 252 | return text; |
| 253 | } |
| 254 | |
| 255 | let styled = text; |
| 256 | |
| 257 | // Apply foreground color (NOT background - that's applied at padding stage) |
| 258 | if (this.defaultTextStyle.color) { |
| 259 | styled = this.defaultTextStyle.color(styled); |
| 260 | } |
| 261 | |
| 262 | // Apply text decorations using this.theme |
| 263 | if (this.defaultTextStyle.bold) { |
| 264 | styled = this.theme.bold(styled); |
| 265 | } |
| 266 | if (this.defaultTextStyle.italic) { |
| 267 | styled = this.theme.italic(styled); |
| 268 | } |
| 269 | if (this.defaultTextStyle.strikethrough) { |
| 270 | styled = this.theme.strikethrough(styled); |
| 271 | } |
| 272 | if (this.defaultTextStyle.underline) { |
| 273 | styled = this.theme.underline(styled); |
| 274 | } |
| 275 | |
| 276 | return styled; |
| 277 | } |
| 278 | |
| 279 | private getDefaultStylePrefix(): string { |
| 280 | if (!this.defaultTextStyle) { |
no test coverage detected