From 6abd166d22b86e8428768b11ee37f919b8112145 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 31 Dec 2020 01:20:46 -0700 Subject: [PATCH] Much improved --- core/fse.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/core/fse.js b/core/fse.js index f5778211..2096f293 100644 --- a/core/fse.js +++ b/core/fse.js @@ -23,7 +23,7 @@ const { } = require('./string_util.js'); const { stripMciColorCodes, - pipeToAnsi, + controlCodesToAnsi, } = require('./color_codes.js'); const Config = require('./config.js').get; const { getAddressedToInfo } = require('./mail_util.js'); @@ -459,9 +459,7 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul const QuoteRegex = /^ ([A-Za-z0-9]{1,2})>([ ]+)([^\r\n]*\r?\n)/gm; msg = msg.replace(QuoteRegex, (m, initials, spc, text) => { - return pipeToAnsi( - ` ${styleL1[0]}${initials}${styleL1[1]}>${spc}${styleL1[2]}${text}${bodyMessageView.styleSGR1}` - ); + return ` ${styleL1[0]}${initials}${styleL1[1]}>${spc}${styleL1[2]}${text}${bodyMessageView.styleSGR1}`; }); } @@ -471,9 +469,7 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul const TearLineRegex = /^--- (.+)$(?![\s\S]*^--- .+$)/m; msg = msg.replace(TearLineRegex, (m, text) => { - return pipeToAnsi( - `${style[0]}--- ${style[1]}${text}${bodyMessageView.styleSGR1}` - ); + return `${style[0]}--- ${style[1]}${text}${bodyMessageView.styleSGR1}`; }); } @@ -482,13 +478,11 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul const OriginRegex = /^([ ]{1,2})\* Origin: (.+)$/m; msg = msg.replace(OriginRegex, (m, spc, text) => { - return pipeToAnsi( - `${spc}${style[0]}* ${style[1]}Origin: ${style[2]}${text}${bodyMessageView.styleSGR1}` - ); + return `${spc}${style[0]}* ${style[1]}Origin: ${style[2]}${text}${bodyMessageView.styleSGR1}`; }); } - bodyMessageView.setText(msg); + bodyMessageView.setText(controlCodesToAnsi(msg)); } } }