parent
b15042dccb
commit
e9db3fab3a
@ -145,10 +145,6 @@ void builder::node(string str, bool add_space) {
|
|||||||
overline_close();
|
overline_close();
|
||||||
s.erase(0, 5);
|
s.erase(0, 5);
|
||||||
|
|
||||||
} else if ((n = s.find("%{A}")) == 0) {
|
|
||||||
cmd_close();
|
|
||||||
s.erase(0, 4);
|
|
||||||
|
|
||||||
} else if ((n = s.find("%{")) == 0 && (m = s.find('}')) != string::npos) {
|
} else if ((n = s.find("%{")) == 0 && (m = s.find('}')) != string::npos) {
|
||||||
append(s.substr(n, m + 1));
|
append(s.substr(n, m + 1));
|
||||||
s.erase(n, m + 1);
|
s.erase(n, m + 1);
|
||||||
@ -506,10 +502,6 @@ void builder::cmd(mousebtn index, string action, bool condition) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
action = string_util::replace_all(action, ":", "\\:");
|
action = string_util::replace_all(action, ":", "\\:");
|
||||||
action = string_util::replace_all(action, "$", "\\$");
|
|
||||||
action = string_util::replace_all(action, "}", "\\}");
|
|
||||||
action = string_util::replace_all(action, "{", "\\{");
|
|
||||||
action = string_util::replace_all(action, "%", "\x0025");
|
|
||||||
|
|
||||||
tag_open(syntaxtag::A, to_string(button) + ":" + action + ":");
|
tag_open(syntaxtag::A, to_string(button) + ":" + action + ":");
|
||||||
}
|
}
|
||||||
|
@ -266,11 +266,18 @@ mousebtn parser::parse_action_btn(string data) {
|
|||||||
* Process action command string
|
* Process action command string
|
||||||
*/
|
*/
|
||||||
string parser::parse_action_cmd(const string& data) {
|
string parser::parse_action_cmd(const string& data) {
|
||||||
size_t start, end;
|
size_t start{0};
|
||||||
if ((start = data.find(':')) == string::npos) {
|
while ((start = data.find(':', start)) != string::npos && data[start - 1] == '\\') {
|
||||||
|
start++;
|
||||||
|
}
|
||||||
|
if (start == string::npos) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if ((end = data.find(':', start + 1)) == string::npos) {
|
size_t end{start + 1};
|
||||||
|
while ((end = data.find(':', end)) != string::npos && data[end - 1] == '\\') {
|
||||||
|
end++;
|
||||||
|
}
|
||||||
|
if (end == string::npos) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return string_util::trim(data.substr(start, end), ':');
|
return string_util::trim(data.substr(start, end), ':');
|
||||||
|
Loading…
Reference in New Issue
Block a user