Skip to content

Commit

Permalink
parse: fix bug for gui mode where span tags will be replaced with &lt…
Browse files Browse the repository at this point in the history
…;span>
  • Loading branch information
Toni500github committed Aug 30, 2024
1 parent 613b257 commit 846809e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
15 changes: 8 additions & 7 deletions assets/ascii/mx_small.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
${c3} \\\\ /
\\\\/
\\\\
/\\/ \\\\
/ \\ /\\
/ \\/ \\
/__________\\
${cyan}${blue}
${1} \\ /
${1} \\/
${1} \\
${1} /\/ \\
${1} / \ /\
${1} / \/ \
${1}/__________\
5 changes: 4 additions & 1 deletion include/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<os.kernel> <- Kernel" it won't work on GUI mode?"
# A: replace "<-" with "\\<-". It won't affect the printing in terminal
layout = [
"${auto}$<user.name>${0}@${auto2}$<os.hostname>",
"${auto2}$<user.name>${0}@${auto2}$<os.hostname>",
"$<user.sep_title>",
"${auto}OS: $<os.name> $<system.arch>",
"${auto}Host: $<system.host>",
Expand Down
4 changes: 4 additions & 0 deletions src/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, "\\<", "&lt;");
replace_str(output, "&lt;span>", "\\<span>");
replace_str(output, "&lt;/span>", "\\</span>");
}
else
replace_str(output, "\\<", "<");

Expand Down

0 comments on commit 846809e

Please sign in to comment.