Also replace DEL with its graphical equivalent
This commit is contained in:
parent
91849e2d6a
commit
e5138ff737
|
@ -65,11 +65,14 @@ function ircbotRun(program, input, maxCycles = 400000) {
|
||||||
|
|
||||||
// Replace all characters < 0x20 except for IRC formatting codes
|
// Replace all characters < 0x20 except for IRC formatting codes
|
||||||
// with their graphical representations at U+24xx
|
// with their graphical representations at U+24xx
|
||||||
|
// Also replace DEL with U+2421
|
||||||
let formattingChars = [0x02, 0x03, 0x0f, 0x12, 0x15];
|
let formattingChars = [0x02, 0x03, 0x0f, 0x12, 0x15];
|
||||||
output = Array.from(output).map(c => {
|
output = Array.from(output).map(c => {
|
||||||
let codePoint = c.codePointAt(0);
|
let codePoint = c.codePointAt(0);
|
||||||
if(codePoint < 0x20 && !formattingChars.includes(codePoint)) {
|
if(codePoint < 0x20 && !formattingChars.includes(codePoint)) {
|
||||||
return String.fromCodePoint(0x2400 + codePoint);
|
return String.fromCodePoint(0x2400 + codePoint);
|
||||||
|
} else if(codePoint == 0x7f) {
|
||||||
|
return String.fromCodePoint(0x2421);
|
||||||
} else {
|
} else {
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue