From 94dc9308ea93fba97f59973e6d1914655af42472 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:19:52 +0200 Subject: [PATCH] Replace octal escape sequences (#21156) * replace octal escape characters * Add disable eslint --- src/components/ha-ansi-to-html.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ha-ansi-to-html.ts b/src/components/ha-ansi-to-html.ts index c28fff8b055d..f788a82fd11a 100644 --- a/src/components/ha-ansi-to-html.ts +++ b/src/components/ha-ansi-to-html.ts @@ -90,7 +90,8 @@ class HaAnsiToHtml extends LitElement { private _parseTextToColoredPre(text) { const pre = document.createElement("pre"); - const re = /\033(?:\[(.*?)[@-~]|\].*?(?:\007|\033\\))/g; + // eslint-disable-next-line no-control-regex + const re = /\x1b(?:\[(.*?)[@-~]|\].*?(?:\x07|\x1b\\))/g; let i = 0; const state: State = {