More Handlebars helpers#5937
Conversation
Added cache. Moved in-house helpers to a separate class. Added helpers for mark-down, simple maths, and string comparison.
…lpers # Conflicts: # src/main/java/net/rptools/maptool/util/HandlebarsUtil.java
Added HBLogger to helper registrations.
faster). Added HandlebarsHelperTest with tests for maths helpers. HandlebarsHelpers; - added debug logging to maths helpers. - added number of parameters checks to maths helpers. - set the MathContext for BigDecimal operations. - miscellaneous bug fixes to maths helpers. - improved argument parsing to accept literal array strings, and named arguments. StrListFunctionsTest: fixed annoying type cast message.
Added additional tests for; - embedded - include - partial (tres simple) - json
Change portrait on mouseover to portrait on stat-sheet.
| @Nonnull | ||
| public String resolve(@Nonnull final String path) { | ||
| var location = current.resolveSibling(path).normalize().toString(); | ||
| var location = current.resolveSibling(path).normalize().toString().replace('\\', '/'); |
There was a problem hiding this comment.
This is not needed, please remove and just use / not \ as you are supposed to in a URL! Don't let windows path seperator start infecting things
There was a problem hiding this comment.
This was an effort to get include to work, as somewhere along the line it was being passed a string starting with \.
Removed now.
There was a problem hiding this comment.
Example:
com.github.jknack.handlebars.HandlebarsException: Can't parse: LibraryTemplateSource[library=net.rptools.maptool.model.library.addon.AddOnLibrary@63f6c99f, filename=/\sheets\__include-css.hbs]```
There was a problem hiding this comment.
@cwisniew This is the partials path format issue.
b19ee56 to
58f21da
Compare
…lpers # Conflicts: # src/main/resources/net/rptools/maptool/language/i18n.properties
|
What the hell - grrrr... I did not close this - damnit |
|
Reopen damn you |
Added Javadoc to getHandlebarsInstance
|
Please stay open |
replacing reverse oblique with oblique
|
@cwisniew AddOnLibrary chokes when given a path containing LibraryTemplateLoader resolve(path) performs resolve using Path. Substituting |
Identify the Bug or Feature request
progresses #4158
fixes #5977
Description of the Change
added handlebars helpers.
added template cache.
LibraryTemplateLoader class changes:
Normally it is not noticable, but on consecutive nested calls (i.e. calls to templates inside a template, as used in the
includehelper), Windows paths break the URL lookup, .e.g. when the first character is checked for/but it is a\.New helper list;
previously existing helpers
new helpers
Possible Drawbacks
things don't work as I think they should
Documentation Notes
added handlebars helpers.
This change is