From 8a362a94be67fe992480f013f5cd792a39a2c4bd Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Thu, 12 Mar 2026 15:01:48 -0500 Subject: [PATCH] Revert MicronParser.js truecolor support for now --- meshchatx/src/frontend/js/MicronParser.js | 26 ----------- tests/frontend/MicronParser.test.js | 56 ----------------------- 2 files changed, 82 deletions(-) diff --git a/meshchatx/src/frontend/js/MicronParser.js b/meshchatx/src/frontend/js/MicronParser.js index 89712f5..cefb69b 100644 --- a/meshchatx/src/frontend/js/MicronParser.js +++ b/meshchatx/src/frontend/js/MicronParser.js @@ -755,18 +755,6 @@ class MicronParser { break; case "F": - if (line[i + 4] === "`" && line[i + 5] === "F" && line.length >= i + 9) { - let color = line[i+6]+line[i+1]+line[i+7]+line[i+2]+line[i+8]+line[i+3]; - state.fg_color = color; - skip = 8; - break; - } - if (line[i + 1] === "T" && line.length >= i + 8) { - let color = line.substr(i + 2, 6); - state.fg_color = color; - skip = 7; - break; - } if (line.length >= i + 4) { let color = line.substr(i + 1, 3); state.fg_color = color; @@ -778,20 +766,6 @@ class MicronParser { state.fg_color = state.default_fg; break; case "B": - if (line[i + 4] === "`" && line[i + 5] === "B" && line.length >= i + 9) { - let color = line[i+6]+line[i+1]+line[i+7]+line[i+2]+line[i+8]+line[i+3]; - state.bg_color = color; - skip = 8; - flushPart(); - break; - } - if (line[i + 1] === "T" && line.length >= i + 8) { - let color = line.substr(i + 2, 6); - state.bg_color = color; - skip = 7; - flushPart(); - break; - } if (line.length >= i + 4) { let color = line.substr(i + 1, 3); state.bg_color = color; diff --git a/tests/frontend/MicronParser.test.js b/tests/frontend/MicronParser.test.js index af0fcda..78209c1 100644 --- a/tests/frontend/MicronParser.test.js +++ b/tests/frontend/MicronParser.test.js @@ -102,34 +102,6 @@ describe("MicronParser.js", () => { expect(html).toContain("rgb(170, 187, 204)"); expect(html).toContain("Red Text"); }); - - it("handles FT truecolor (6-char hex)", () => { - const markup = "`FTff00ffMagenta Text`"; - const html = parser.convertMicronToHtml(markup); - expect(html).toContain("rgb(255, 0, 255)"); - expect(html).toContain("Magenta Text"); - }); - - it("prefers FT over F when both could match", () => { - const markup = "`FTabcdefText`"; - const html = parser.convertMicronToHtml(markup); - expect(html).toContain("rgb(171, 205, 239)"); - expect(html).toContain("Text"); - }); - - it("handles fallback truecolor for NomadNet compat (Fbdf`Face)", () => { - const markup = "`Fbdf`FaceColored Text"; - const html = parser.convertMicronToHtml(markup); - expect(html).toContain("rgb(171, 205, 239)"); - expect(html).toContain("Colored Text"); - }); - - it("fallback truecolor takes priority over plain 3-char F", () => { - const markup = "`Ff00`F0ffColored Text"; - const html = parser.convertMicronToHtml(markup); - expect(html).toContain("rgb(15, 240, 240)"); - expect(html).toContain("Colored Text"); - }); }); describe("background color", () => { @@ -139,34 +111,6 @@ describe("MicronParser.js", () => { expect(html).toContain("rgb(255, 255, 255)"); expect(html).toContain("Yellow BG"); }); - - it("handles BT truecolor (6-char hex)", () => { - const markup = "`BT0000ffBlue BG`"; - const html = parser.convertMicronToHtml(markup); - expect(html).toContain("rgb(0, 0, 255)"); - expect(html).toContain("Blue BG"); - }); - - it("prefers BT over B when both could match", () => { - const markup = "`BT112233Text`"; - const html = parser.convertMicronToHtml(markup); - expect(html).toContain("rgb(17, 34, 51)"); - expect(html).toContain("Text"); - }); - - it("handles fallback truecolor for NomadNet compat (Bbdf`Bace)", () => { - const markup = "`Bbdf`BaceYellow BG"; - const html = parser.convertMicronToHtml(markup); - expect(html).toContain("rgb(171, 205, 239)"); - expect(html).toContain("Yellow BG"); - }); - - it("fallback truecolor takes priority over plain 3-char B", () => { - const markup = "`Bf00`B0ffBG Text"; - const html = parser.convertMicronToHtml(markup); - expect(html).toContain("rgb(15, 240, 240)"); - expect(html).toContain("BG Text"); - }); }); it("handles literal mode", () => {