Double quote

This commit is contained in:
iota97 2022-07-08 10:49:33 +02:00
parent 992f1fb8ba
commit d4698d43fd
2 changed files with 26 additions and 18 deletions

View file

@ -61,6 +61,13 @@ static bool ParseLineKey(const std::string &line, size_t &pos, std::string *keyO
static bool ParseLineValue(const std::string &line, size_t &pos, std::string *valueOut) {
std::string value = "";
std::string strippedLine = StripSpaces(line.substr(pos));
if (strippedLine[0] == '"' && strippedLine[strippedLine.size()-1] == '"') {
// Don't remove comment if is surrounded by " "
value += line.substr(pos);
pos = line.npos; // Won't enter the while below
}
while (pos < line.size()) {
size_t next = line.find('#', pos);
if (next == line.npos) {
@ -117,6 +124,7 @@ static bool ParseLine(const std::string& line, std::string* keyOut, std::string*
// 3. A \# in a line is not part of a comment and becomes # in the value.
// 4. Whitespace around values is removed.
// 5. Double quotes around values is removed.
// 6. Value surrounded by double quotes don't parsed to strip comment.
if (line.size() < 2 || line[0] == ';')
return false;

View file

@ -1,22 +1,22 @@
[Default]
Name = Default
ItemStyleFg = \#FFFFFFFF
ItemStyleBg = \#00000055
ItemFocusedStyleFg = \#FFFFFFFF
ItemFocusedStyleBg = \#4CC2EDFF
ItemDownStyleFg = \#FFFFFFFF
ItemDownStyleBg = \#3999BDFF
ItemDisabledStyleFg = \#EEEEEE80
ItemDisabledStyleBg = \#00000055
HeaderStyleFg = \#FFFFFFFF
InfoStyleFg = \#FFFFFFFF
InfoStyleBg = \#00000000
PopupTitleStyleFg = \#59BEE3FF
PopupStyleFg = \#FFFFFFFF
PopupStyleBg = \#303030FF
BackgroundColor = \#244D75FF
UIAtlas = ../ui_atlas
Name = "Default"
ItemStyleFg = "#FFFFFFFF"
ItemStyleBg = "#00000055"
ItemFocusedStyleFg = "#FFFFFFFF"
ItemFocusedStyleBg = "#4CC2EDFF"
ItemDownStyleFg = "#FFFFFFFF"
ItemDownStyleBg = "#3999BDFF"
ItemDisabledStyleFg = "#EEEEEE80"
ItemDisabledStyleBg = "#00000055"
HeaderStyleFg = "#FFFFFFFF"
InfoStyleFg = "#FFFFFFFF"
InfoStyleBg = "#00000000"
PopupTitleStyleFg = "#59BEE3FF"
PopupStyleFg = "#FFFFFFFF"
PopupStyleBg = "#303030FF"
BackgroundColor = "#244D75FF"
UIAtlas = "../ui_atlas"
# Colors are either in the format \#RGBA or 0xABGR (e.g. green is \#00FF00FF or 0xFF00FF00)
# Colors are either in the format "#RGBA" or 0xABGR (e.g. green is \#00FF00FF or 0xFF00FF00)
# Atlas should be in the format path/to/filename where both filename.zim and filename.meta are
# Unprovided entry will use the default value