diff --git a/components/REPL/REPLHistory.tsx b/components/REPL/REPLHistory.tsx index b41b544..27cddf8 100644 --- a/components/REPL/REPLHistory.tsx +++ b/components/REPL/REPLHistory.tsx @@ -36,7 +36,7 @@ const REPLHistory: NextPage = ({history, inputRef}) => { while (idxStart !== -1 && idxSep !== -1 && idxEnd !== -1) { const linkText = line.substring(idxStart+2, idxSep); const linkHref = line.substring(idxSep+1, idxEnd); - const isLocal = linkHref.startsWith("https://c0ntroller.de") || linkHref.startsWith("/"); + const isLocal = linkHref.startsWith("https://c0ntroller.de") || linkHref.startsWith("/") || linkHref.startsWith("#"); result.push(line.substring(0, idxStart)); result.push({linkText}); @@ -46,7 +46,9 @@ const REPLHistory: NextPage = ({history, inputRef}) => { idxSep = line.indexOf("|", idxStart); idxEnd = line.indexOf("}", idxSep); } - result.push(line.substring(idxEnd+1)); + + // Its already cut off + result.push(line); return result; }; @@ -70,7 +72,9 @@ const REPLHistory: NextPage = ({history, inputRef}) => { idxStart = line.indexOf("%{"); idxEnd = line.indexOf("}", idxStart); } - result.push(line.substring(idxEnd+1)); + + // Its already cut off + result.push(line); return result; }; diff --git a/lib/commands/definitions.ts b/lib/commands/definitions.ts index d1f80fc..1ce4c37 100644 --- a/lib/commands/definitions.ts +++ b/lib/commands/definitions.ts @@ -225,15 +225,16 @@ const color: Command = { window.document.documentElement.style.removeProperty("--repl-color-hint"); return ["Color reset."]; } else { + let color: Color; try { - const color = Color(args.join().trim()); - window?.document.documentElement.style.setProperty("--repl-color", color.string()); - window?.document.documentElement.style.setProperty("--repl-color-link", color.lighten(0.3).rgb().string()); - window?.document.documentElement.style.setProperty("--repl-color-hint", color.fade(0.7).string()); + color = Color(args.join().trim()); } catch { return ["Invalid color!"]; } - return ["Color set.", "#{Link|https://google.de}.", "%{command}"]; + window?.document.documentElement.style.setProperty("--repl-color", color.string()); + window?.document.documentElement.style.setProperty("--repl-color-link", color.lighten(0.3).rgb().string()); + window?.document.documentElement.style.setProperty("--repl-color-hint", color.fade(0.7).string()); + return ["Color set | #{Link|#} | %{help}"]; } } };