mirror of
https://github.com/pantor/inja.git
synced 2026-06-12 13:59:51 +00:00
fix search directory for string templates
This commit is contained in:
@@ -33,7 +33,7 @@ protected:
|
||||
std::string output_path;
|
||||
|
||||
public:
|
||||
Environment(): Environment("") {}
|
||||
Environment(): Environment("./") {}
|
||||
|
||||
explicit Environment(const std::string& global_path): input_path(global_path), output_path(global_path) {}
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
|
||||
Template parse(std::string_view input) {
|
||||
Parser parser(parser_config, lexer_config, template_storage, function_storage);
|
||||
return parser.parse(input);
|
||||
return parser.parse(input, input_path);
|
||||
}
|
||||
|
||||
Template parse_template(const std::string& filename) {
|
||||
|
||||
@@ -631,10 +631,6 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
Template parse(std::string_view input) {
|
||||
return parse(input, "./");
|
||||
}
|
||||
|
||||
void parse_into_template(Template& tmpl, std::string_view filename) {
|
||||
std::string_view path = filename.substr(0, filename.find_last_of("/\\") + 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user