Commit fa303fb7 authored by Patrick Storz's avatar Patrick Storz 🦄

Allow colons in action parameter values

Fixes #1599


(cherry picked from commit e8bcc625)
parent cc76837b
Pipeline #156498699 failed with stages
in 74 minutes and 6 seconds
......@@ -1046,10 +1046,13 @@ template<class T>
void
ConcreteInkscapeApplication<T>::parse_actions(const Glib::ustring& input, action_vector_t& action_vector)
{
const auto re_colon = Glib::Regex::create("\\s*:\\s*");
// Split action list
std::vector<Glib::ustring> tokens = Glib::Regex::split_simple("\\s*;\\s*", input);
for (auto token : tokens) {
std::vector<Glib::ustring> tokens2 = Glib::Regex::split_simple("\\s*:\\s*", token);
// Note: split into 2 tokens max ("param:value"); allows value to contain colon (e.g. abs. paths on Windows)
std::vector<Glib::ustring> tokens2 = re_colon->split(token, 0, static_cast<Glib::RegexMatchFlags>(0), 2);
std::string action;
std::string value;
if (tokens2.size() > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment