You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At constructor of PartialCode.java, in line 23, the slash it looks for is hard-coded to be forward-slash (Used everywhere except Windows):
protected PartialCode(TemplateContext tc, DefaultMustacheFactory df, Mustache mustache, String type, String variable) {
super(tc, df, mustache, variable, type);
// Use the name of the parent to get the name of the partial
String file = tc.file();
int dotindex = file.lastIndexOf(".");
extension = dotindex == -1 ? "" : file.substring(dotindex);
int slashindex = file.lastIndexOf("/"); <------------------------------ line 23
dir = file.substring(0, slashindex + 1);
recrusionLimit = df.getRecursionLimit();
}
When running on Windows OS, the file's path is usually stored using back-slashes and .lastIndexOf("/") will fail to find the correct index.
The text was updated successfully, but these errors were encountered:
Inside the templates you should only use forward slashes (to make them work cross platform). Is there another way that this gets populated such that a backslash might appear?
At constructor of PartialCode.java, in line 23, the slash it looks for is hard-coded to be forward-slash (Used everywhere except Windows):
When running on Windows OS, the file's path is usually stored using back-slashes and
.lastIndexOf("/")
will fail to find the correct index.The text was updated successfully, but these errors were encountered: