From 425c7d0eace58b340764a5361d604ad6f1313e8d Mon Sep 17 00:00:00 2001 From: remsky Date: Sat, 8 Feb 2025 01:32:18 -0700 Subject: [PATCH] -Fix bug in webui causing artifical sentence breaks at text editor page boundaries --- web/src/components/TextEditor.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 = '';