[core] Allow the use of special characters in property field names
Fixes #4336
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
const static std::string tokenReservedChars = "{}()[]<>$=:;.,^";
|
||||
const static std::string tokenReservedChars = "{}";
|
||||
|
||||
// Replaces {tokens} in a string by calling the lookup function.
|
||||
template <typename Lookup>
|
||||
|
||||
@@ -39,12 +39,12 @@ TEST(Token, replaceTokens) {
|
||||
if (token == "dashed-property") return "dashed";
|
||||
return "";
|
||||
}));
|
||||
EXPECT_EQ("colonized", mbgl::util::replaceTokens("{colon:property}", [](const std::string& token) -> std::string {
|
||||
if (token == "colon:property") return "colonized";
|
||||
return "";
|
||||
}));
|
||||
EXPECT_EQ("150 m", mbgl::util::replaceTokens("{HØYDE} m", [](const std::string& token) -> std::string {
|
||||
if (token == "HØYDE") return "150";
|
||||
return "";
|
||||
}));
|
||||
EXPECT_EQ("reserved {for:future} use", mbgl::util::replaceTokens("reserved {for:future} use", [](const std::string& token) -> std::string {
|
||||
if (token == "for:future") return "unknown";
|
||||
return "";
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user