Skip to content

Commit 846809e

Browse files
committed
parse: fix bug for gui mode where span tags will be replaced with <span>
1 parent 613b257 commit 846809e

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

assets/ascii/mx_small.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
${c3} \\\\ /
2-
\\\\/
3-
\\\\
4-
/\\/ \\\\
5-
/ \\ /\\
6-
/ \\/ \\
7-
/__________\\
1+
${cyan}${blue}
2+
${1} \\ /
3+
${1} \\/
4+
${1} \\
5+
${1} /\/ \\
6+
${1} / \ /\
7+
${1} / \/ \
8+
${1}/__________\

include/config.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ inline constexpr std::string_view AUTOCONFIG = R"#([config]
117117
# A: there is ${0}. e.g "${red}hello ${0}world, yet again" will only print "hello" in red, and then "world, yet again" normal
118118
# Or, if you want to reset color and make it bold, use ${1}
119119
120+
# Q: "Why when I use something like "$<os.kernel> <- Kernel" it won't work on GUI mode?"
121+
# A: replace "<-" with "\\<-". It won't affect the printing in terminal
122+
120123
layout = [
121-
"${auto}$<user.name>${0}@${auto2}$<os.hostname>",
124+
"${auto2}$<user.name>${0}@${auto2}$<os.hostname>",
122125
"$<user.sep_title>",
123126
"${auto}OS: $<os.name> $<system.arch>",
124127
"${auto}Host: $<system.host>",

src/parse.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,11 @@ std::string parse(const std::string_view input, systemInfo_t& systemInfo, std::s
416416
// "But.. what if I want '<<<<<-' " just put \ on each one of < :D
417417
// sorry, not my problem, but pangos
418418
if (config.gui)
419+
{
419420
replace_str(output, "\\<", "&lt;");
421+
replace_str(output, "&lt;span>", "\\<span>");
422+
replace_str(output, "&lt;/span>", "\\</span>");
423+
}
420424
else
421425
replace_str(output, "\\<", "<");
422426

0 commit comments

Comments
 (0)