Upgrading from version 4.2.2 to 4.3.0, specifically because of #500 (580acba), might result in register_templates_directory not working identically.
In v4.2.2, you could register files with an extension that contained multiple .'s:
handlebars.register_templates_directory(".hbs.html", "templates");
This would result in all files ending in .hbs.html to be loaded. After upgrading, this breaks, as now, Path::extension is used to determine the extension:
|
.filter(|tpl_path| { |
|
tpl_path |
|
.extension() |
|
.map(|extension| extension == tpl_extension) |
|
.unwrap_or(false) |
|
}) |
Thus, in the example above, no files would ever match, since Path::extension considers html as the extension.
The documentation doesn't mention anything regarding the format of extension.
If my use-case is invalid, then the docs should at least mention that extension must never contain a . (excluding the first character), or that Path::extension will be used to determine the extension. Furthermore, the changelog could mention, that this previously accepted but invalid use will no longer work.
Upgrading from version 4.2.2 to 4.3.0, specifically because of #500 (580acba), might result in
register_templates_directorynot working identically.In v4.2.2, you could register files with an extension that contained multiple
.'s:This would result in all files ending in
.hbs.htmlto be loaded. After upgrading, this breaks, as now,Path::extensionis used to determine the extension:handlebars-rust/src/registry.rs
Lines 311 to 316 in 74cf5a2
Thus, in the example above, no files would ever match, since
Path::extensionconsidershtmlas the extension.The documentation doesn't mention anything regarding the format of
extension.If my use-case is invalid, then the docs should at least mention that
extensionmust never contain a.(excluding the first character), or thatPath::extensionwill be used to determine the extension. Furthermore, the changelog could mention, that this previously accepted but invalid use will no longer work.