summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-06-03 16:25:00 +0200
committerGitHub <noreply@github.com>2019-06-03 16:25:00 +0200
commit22583ec6a39bb56943c78c0ed9a094b28b666b75 (patch)
tree5b38ac679874063e57b5569bfdec882b788871ac
parentb9dc2e7e4dd38621ef0dd07d208ffc5468954adb (diff)
parentcc004485bc994c39065a8a4a6cff861a383f6fb0 (diff)
Merge pull request #29432 from bojidar-bg/29401-tscn-serialization
Escape node names when saving to .tscn
-rw-r--r--scene/resources/resource_format_text.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp
index 6e7bb27e74..0921c0dae9 100644
--- a/scene/resources/resource_format_text.cpp
+++ b/scene/resources/resource_format_text.cpp
@@ -1712,15 +1712,15 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
Vector<StringName> groups = state->get_node_groups(i);
String header = "[node";
- header += " name=\"" + String(name) + "\"";
+ header += " name=\"" + String(name).c_escape() + "\"";
if (type != StringName()) {
header += " type=\"" + String(type) + "\"";
}
if (path != NodePath()) {
- header += " parent=\"" + String(path.simplified()) + "\"";
+ header += " parent=\"" + String(path.simplified()).c_escape() + "\"";
}
if (owner != NodePath() && owner != NodePath(".")) {
- header += " owner=\"" + String(owner.simplified()) + "\"";
+ header += " owner=\"" + String(owner.simplified()).c_escape() + "\"";
}
if (index >= 0) {
header += " index=\"" + itos(index) + "\"";