mirror of
https://github.com/godotengine/godot.git
synced 2025-10-15 02:49:24 +00:00
Escape node names when saving to .tscn
Fixes #29401
(cherry picked from commit cc004485bc
)
This commit is contained in:

committed by
Rémi Verschelde

parent
4d6517fad3
commit
22abeff592
@@ -1664,15 +1664,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) + "\"";
|
||||
|
Reference in New Issue
Block a user