From 15bbca8d776f67fa2d1ce9380467aabf5ce027f6 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sat, 20 Jun 2026 10:36:07 +0200 Subject: [PATCH] fixed: whitespace issue --- AppKit/CPTextView/_CPRTFParser.j | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AppKit/CPTextView/_CPRTFParser.j b/AppKit/CPTextView/_CPRTFParser.j index f04654a05..9028e49f5 100644 --- a/AppKit/CPTextView/_CPRTFParser.j +++ b/AppKit/CPTextView/_CPRTFParser.j @@ -979,7 +979,11 @@ var kRgsymRtf = { else { _freename += tmp; - [self _appendPlainString:tmp]; + // Only append literal spaces to the document if we are in the active body state + if (_curState == 0) + { + [self _appendPlainString:tmp]; + } } break; @@ -1025,7 +1029,8 @@ var kRgsymRtf = { if (_hexreturn) { - if (ch.length > 0) + // Only append decoded characters if we are in the active body state + if (ch.length > 0 && _curState === 0) { var byteVal = parseInt(ch, 16); var unicodeVal = byteVal;