mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-22 18:56:00 +02:00
* Some minor code cleanup
* Some experimental stuff - likely to just drop soon, so no need for a branch * Minor changes to ansi escape parser
This commit is contained in:
parent
77a9306afa
commit
4f719259fe
5 changed files with 296 additions and 39 deletions
|
@ -110,7 +110,8 @@ function ANSIEscapeParser(options) {
|
|||
}
|
||||
}
|
||||
|
||||
self.emit('chunk', text);
|
||||
//self.emit('chunk', text);
|
||||
self.emit('literal', text);
|
||||
}
|
||||
|
||||
function getProcessedMCI(mci) {
|
||||
|
@ -166,7 +167,10 @@ function ANSIEscapeParser(options) {
|
|||
});
|
||||
|
||||
if(self.mciReplaceChar.length > 0) {
|
||||
self.emit('chunk', ansi.getSGRFromGraphicRendition(self.graphicRenditionForErase));
|
||||
//self.emit('chunk', ansi.getSGRFromGraphicRendition(self.graphicRenditionForErase));
|
||||
const sgrCtrl = ansi.getSGRFromGraphicRendition(self.graphicRenditionForErase);
|
||||
self.emit('control', sgrCtrl, 'm', sgrCtrl.slice(2).split(/[\;m]/).slice(0, 3));
|
||||
//self.emit('control', ansi.getSGRFromGraphicRendition(self.graphicRenditionForErase));
|
||||
literal(new Array(match[0].length + 1).join(self.mciReplaceChar));
|
||||
} else {
|
||||
literal(match[0]);
|
||||
|
@ -226,7 +230,8 @@ function ANSIEscapeParser(options) {
|
|||
|
||||
escape(opCode, args);
|
||||
|
||||
self.emit('chunk', match[0]);
|
||||
//self.emit('chunk', match[0]);
|
||||
self.emit('control', match[0], opCode, args);
|
||||
}
|
||||
} while(0 !== re.lastIndex);
|
||||
|
||||
|
@ -479,4 +484,5 @@ ANSIEscapeParser.styles = {
|
|||
8 : 'invisibleOn', // FG set to BG
|
||||
28 : 'invisibleOff', // Not supported by most BBS-like terminals
|
||||
};
|
||||
Object.freeze(ANSIEscapeParser.styles);
|
||||
Object.freeze(ANSIEscapeParser.styles);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue