mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 03:06:04 +02:00
Fix some breakage caused by word wrapping with ESC seqs
This commit is contained in:
parent
d47f26004d
commit
dc39998841
1 changed files with 7 additions and 1 deletions
|
@ -24,7 +24,13 @@ function wordWrapText2(text, options) {
|
|||
options.tabWidth = options.tabWidth || 4;
|
||||
options.tabChar = options.tabChar || ' ';
|
||||
|
||||
const REGEXP_GOBBLE = new RegExp(`.{0,${options.width}}`, 'g');
|
||||
//const REGEXP_GOBBLE = new RegExp(`.{0,${options.width}}`, 'g');
|
||||
//
|
||||
// For a given word, match 0->options.width chars -- alwasy include a full trailing ESC
|
||||
// sequence if present!
|
||||
//
|
||||
// :TODO: Need to create ansi.getMatchRegex or something - this is used all over
|
||||
const REGEXP_GOBBLE = new RegExp(`.{0,${options.width}}\\x1b\\[[\\?=;0-9]*[ABCDEFGHJKLMSTfhlmnprsu]|.{0,${options.width}}`, 'g');
|
||||
|
||||
let m;
|
||||
let word;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue