()
| 217 | |
| 218 | // Called on Enter to expand full pasted content before submission |
| 219 | expandAllPasteBlocks(): void { |
| 220 | for (const [placeholder, originalContent] of this._pasteMap.entries()) { |
| 221 | const regex = new RegExp(this.escapeRegex(placeholder), "g"); |
| 222 | // Normalize line endings to prevent terminal display issues |
| 223 | const normalizedContent = originalContent |
| 224 | .replace(/\r\n/g, "\n") |
| 225 | .replace(/\r/g, "\n"); |
| 226 | this._text = this._text.replace(regex, normalizedContent); |
| 227 | } |
| 228 | this._pasteMap.clear(); |
| 229 | } |
| 230 | |
| 231 | // Add image to buffer and return placeholder |
| 232 | addImage(imageBuffer: Buffer): string { |
no test coverage detected