diff --git a/include/inja/environment.hpp b/include/inja/environment.hpp index 01b78996..2ee547ab 100644 --- a/include/inja/environment.hpp +++ b/include/inja/environment.hpp @@ -105,7 +105,7 @@ class Environment { Template parse(std::string_view input) { Parser parser(parser_config, lexer_config, template_storage, function_storage); - return parser.parse(input, input_path); + return *parser.parse(input, input_path); } Template parse_template(const std::string& filename) { diff --git a/include/inja/parser.hpp b/include/inja/parser.hpp index 6f35535b..68431339 100644 --- a/include/inja/parser.hpp +++ b/include/inja/parser.hpp @@ -621,9 +621,9 @@ class Parser { const FunctionStorage& function_storage) : config(parser_config), lexer(lexer_config), template_storage(template_storage), function_storage(function_storage) {} - Template parse(std::string_view input, std::string_view path) { - auto result = Template(static_cast(input)); - parse_into(result, path); + std::shared_ptr