From 8d6b550e0b30983886dc240fd3261fae786d5693 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 7 Jan 2021 11:36:34 +0000 Subject: Implement support for more XML and IRC colour code escapes. --- include/configparser.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configparser.h b/include/configparser.h index 632679218..9fb66675f 100644 --- a/include/configparser.h +++ b/include/configparser.h @@ -33,9 +33,27 @@ struct ParseStack ParseStack(ServerConfig* conf) : output(conf->config_data), FilesOutput(conf->Files), errstr(conf->errstr) { - vars["amp"] = "&"; + // Special character escapes. + vars["newline"] = "\n"; + vars["nl"] = "\n"; + + // XML escapes. + vars["amp"] = "&"; + vars["apos"] = "'"; + vars["gt"] = ">"; + vars["lt"] = "<"; vars["quot"] = "\""; - vars["newline"] = vars["nl"] = "\n"; + + // IRC formatting codes. + vars["irc.bold"] = "\x02"; + vars["irc.color"] = "\x03"; + vars["irc.colour"] = "\x03"; + vars["irc.italic"] = "\x1D"; + vars["irc.monospace"] = "\x11"; + vars["irc.reset"] = "\x0F"; + vars["irc.reverse"] = "\x16"; + vars["irc.strikethrough"] = "\x1E"; + vars["irc.underline"] = "\x1F"; } bool ParseFile(const std::string& name, int flags, const std::string& mandatory_tag = std::string(), bool isexec = false); void DoInclude(ConfigTag* includeTag, int flags); -- cgit v1.2.3