#660 sanitize hyphen in attributes (#1267)

closes #660
This commit is contained in:
Scott Fennell 2022-05-25 13:08:11 -05:00 committed by GitHub
parent 8ef78f4197
commit 83652ad811
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,10 @@ std::string sanitize(const std::string& text) {
for (char c : {'<', '>', ' ', ',', ':', '*', '[', ']'}) {
std::replace(result.begin(), result.end(), c, '_');
}
// Catches templates with negative default values (iss #660)
for (char c : {'-'}) {
std::replace(result.begin(), result.end(), c, 'n');
}
return result ;
}