diff --git a/web/src/components/TextEditor.js b/web/src/components/TextEditor.js index 6889540..f3884cd 100644 --- a/web/src/components/TextEditor.js +++ b/web/src/components/TextEditor.js @@ -88,8 +88,8 @@ export default class TextEditor { this.updatePageDisplay(); } - // Update full text and char count - this.fullText = this.pages.join('\n'); + // Update full text and char count - join with space since pages are just for UI + this.fullText = this.pages.join(' '); this.updateCharCount(); if (this.options.onTextChange) { @@ -170,8 +170,9 @@ export default class TextEditor { return; } - this.fullText = text; - const words = text.split(/\s+/); + // Store original text to preserve natural line breaks + this.fullText = text.trim(); + const words = text.trim().split(/\s+/); this.pages = []; let currentPage = '';