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

@ -2,22 +2,23 @@
'use strict';
// ENiGMA½
const Log = require('../../logger.js').log;
const { ServerModule } = require('../../server_module.js');
const Config = require('../../config.js').get;
const Log = require('../../logger.js').log;
const { ServerModule } = require('../../server_module.js');
const Config = require('../../config.js').get;
const {
splitTextAtTerms,
isAnsi,
cleanControlCodes
} = require('../../string_util.js');
} = require('../../string_util.js');
const {
getMessageConferenceByTag,
getMessageAreaByTag,
getMessageListForArea,
} = require('../../message_area.js');
const { sortAreasOrConfs } = require('../../conf_area_util.js');
const AnsiPrep = require('../../ansi_prep.js');
const { wordWrapText } = require('../../word_wrap.js');
} = require('../../message_area.js');
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,9 +217,13 @@ exports.getModule = class GopherModule extends ServerModule {
}
);
} else {
const prepped = splitTextAtTerms(cleanControlCodes(body, { all : true } ) )
.map(l => (wordWrapText(l, { width : WordWrapColumn } ).wrapped || []).join('\n'))
.join('\n');
const cleaned = stripMciColorCodes(
cleanControlCodes(body, { all : true } )
);
const prepped =
splitTextAtTerms(cleaned)
.map(l => (wordWrapText(l, { width : WordWrapColumn } ).wrapped || []).join('\n'))
.join('\n');
return cb(prepped);
}