From 846809e2f567a092d83bbb84191a23aa3072bafa Mon Sep 17 00:00:00 2001 From: Toni500git Date: Fri, 30 Aug 2024 20:47:39 +0200 Subject: [PATCH] parse: fix bug for gui mode where span tags will be replaced with <span> --- assets/ascii/mx_small.txt | 15 ++++++++------- include/config.hpp | 5 ++++- src/parse.cpp | 4 ++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/assets/ascii/mx_small.txt b/assets/ascii/mx_small.txt index c50587c..6527734 100644 --- a/assets/ascii/mx_small.txt +++ b/assets/ascii/mx_small.txt @@ -1,7 +1,8 @@ -${c3} \\\\ / - \\\\/ - \\\\ - /\\/ \\\\ - / \\ /\\ - / \\/ \\ -/__________\\ +${cyan}${blue} +${1} \\ / +${1} \\/ +${1} \\ +${1} /\/ \\ +${1} / \ /\ +${1} / \/ \ +${1}/__________\ diff --git a/include/config.hpp b/include/config.hpp index b7abc7e..40d453e 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -117,8 +117,11 @@ inline constexpr std::string_view AUTOCONFIG = R"#([config] # A: there is ${0}. e.g "${red}hello ${0}world, yet again" will only print "hello" in red, and then "world, yet again" normal # Or, if you want to reset color and make it bold, use ${1} +# Q: "Why when I use something like "$ <- Kernel" it won't work on GUI mode?" +# A: replace "<-" with "\\<-". It won't affect the printing in terminal + layout = [ - "${auto}$${0}@${auto2}$", + "${auto2}$${0}@${auto2}$", "$", "${auto}OS: $ $", "${auto}Host: $", diff --git a/src/parse.cpp b/src/parse.cpp index cbee7d9..b477cf4 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -416,7 +416,11 @@ std::string parse(const std::string_view input, systemInfo_t& systemInfo, std::s // "But.. what if I want '<<<<<-' " just put \ on each one of < :D // sorry, not my problem, but pangos if (config.gui) + { replace_str(output, "\\<", "<"); + replace_str(output, "<span>", "\\"); + replace_str(output, "</span>", "\\"); + } else replace_str(output, "\\<", "<");