From 18e2609f112c20683164a9758aa58e12253bb74c Mon Sep 17 00:00:00 2001
From: patrick96
Date: Wed, 10 Oct 2018 16:46:40 +0200
Subject: [PATCH] fix(builder): Escape all colons in action command
Fixes #984
---
src/components/builder.cpp | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/components/builder.cpp b/src/components/builder.cpp
index 1d247729..bdb3f042 100644
--- a/src/components/builder.cpp
+++ b/src/components/builder.cpp
@@ -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(index)) + ":" + action + ":");
}
}