Strip MCI/Pipe codes

This commit is contained in:
Bryan Ashby 2018-12-15 01:55:38 -07:00
parent a3ba57b0b8
commit dba2fc18f6
1 changed files with 16 additions and 11 deletions

View File

@ -18,6 +18,7 @@ const {
const { sortAreasOrConfs } = require('../../conf_area_util.js');
const AnsiPrep = require('../../ansi_prep.js');
const { wordWrapText } = require('../../word_wrap.js');
const { stripMciColorCodes } = require('../../color_codes.js');
// deps
const net = require('net');
@ -216,7 +217,11 @@ exports.getModule = class GopherModule extends ServerModule {
}
);
} else {
const prepped = splitTextAtTerms(cleanControlCodes(body, { all : true } ) )
const cleaned = stripMciColorCodes(
cleanControlCodes(body, { all : true } )
);
const prepped =
splitTextAtTerms(cleaned)
.map(l => (wordWrapText(l, { width : WordWrapColumn } ).wrapped || []).join('\n'))
.join('\n');