From 2fe82c604c90fdded899bd611ab697cbbbb314df Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 26 Feb 2024 11:52:13 +0100 Subject: [PATCH] Fix binds in HTMLTemplate. --- modules/web/html/html_template.cpp | 4 ++-- modules/web/html/html_template_data.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/web/html/html_template.cpp b/modules/web/html/html_template.cpp index 4597d21a3..f36159b3d 100644 --- a/modules/web/html/html_template.cpp +++ b/modules/web/html/html_template.cpp @@ -727,11 +727,11 @@ void HTMLTemplate::_bind_methods() { ClassDB::bind_method(D_METHOD("get_template_text", "name"), &HTMLTemplate::get_template_text); ClassDB::bind_method(D_METHOD("process_template_expression", "expression", "data"), &HTMLTemplate::process_template_expression); - ClassDB::bind_method(D_METHOD("render_template", "text", "request", "data"), &HTMLTemplate::render_template); + ClassDB::bind_method(D_METHOD("render_template", "text", "data"), &HTMLTemplate::render_template); ClassDB::bind_method(D_METHOD("get_and_render_template", "name", "request", "data"), &HTMLTemplate::get_and_render_template); - BIND_VMETHOD(MethodInfo("_render", + BIND_VMETHOD(MethodInfo(Variant::STRING, "_render", PropertyInfo(Variant::OBJECT, "request", PROPERTY_HINT_RESOURCE_TYPE, "WebServerRequest"), PropertyInfo(Variant::DICTIONARY, "data"))); diff --git a/modules/web/html/html_template_data.cpp b/modules/web/html/html_template_data.cpp index 5cf87d565..2ad640470 100644 --- a/modules/web/html/html_template_data.cpp +++ b/modules/web/html/html_template_data.cpp @@ -144,7 +144,7 @@ void HTMLTemplateData::load_from_string(const String &p_data) { // Section header: [ Section Name ] // Should not have whitespace in front and back String l = lines[i]; - + if (l.begins_with("[") && l.ends_with("]")) { if (!current_section_name.empty()) { _templates[current_section_name] = current_str;