| 449 | // `str` starts a line in the generated output. Any match after offset 0 |
| 450 | // necessarily follows a line break inside `str`, so it always gets indented. |
| 451 | const indentPiece = (str: string) => { |
| 452 | if (str === '') |
| 453 | return str |
| 454 | |
| 455 | const indented = str.replace(pattern, (match: string, offset: number) => |
| 456 | offset > 0 || shouldIndentNextCharacter ? `${resolvedIndentStr}${match}` : match) |
| 457 | |
| 458 | shouldIndentNextCharacter = str[str.length - 1] === '\n' |
| 459 | |
| 460 | return indented |
| 461 | } |
| 462 | |
| 463 | this.intro = indentPiece(this.intro) |
| 464 | |