fix(builder): Escape all colons in action command

Fixes #984
This commit is contained in:
patrick96 2018-10-10 16:46:40 +02:00 committed by NBonaparte
parent fa693aecf8
commit 18e2609f11
1 changed files with 1 additions and 5 deletions

View File

@ -499,11 +499,7 @@ void builder::underline_close() {
*/
void builder::cmd(mousebtn index, string action, bool condition) {
if (condition && !action.empty()) {
size_t p{0};
while ((p = action.find(':', p)) != string::npos && action[p - 1] != '\\') {
action.insert(p, 1, '\\');
p++;
}
action = string_util::replace_all(action, ":", "\\:");
tag_open(syntaxtag::A, to_string(static_cast<int>(index)) + ":" + action + ":");
}
}