A real .NET Handlebars engine
Added in required sdk's for the release build which was missed in #578
By adjusting the TFM'S we have been able to produce a package with no dependencies on the latest frameworks hence an optimised dependency graph.
The following frameworks have been added:
The following frameworks even though requested was not added:
The following frameworks were removed:
Closes: #573 Closes: #415
@oformaniuk and @thompson-tomo
EmbedUntrackedSources
to remove one warning, see https://nuget.info/packages/Handlebars.Net/2.1.4
I would also suggest changing to use newer GH Actions images for building so that other warnings would go away (old SDK in use). Maybe another modernization step could be removing old unsupported full framework targets and only support oldest supported net462
. Adding net6.0
target would allow one target without dependency on Microsoft.Csharp
.
When evaluating templates with partials, it is possible to recurse in the evaluation of those partials. This can be useful for dealing with tree like data, such as rendering a list of friends-of-friends-of-friends-of-etc....
The ability to recurse can lead to stack overflows. For example if a sufficiently deep tree is provided as input data, or more simply if the partial calls itself in an infinite loop. As a stack overflow terminates the process, this is not desirable behaviour as it is an unavoidable crash.
To resolve this a configurable PartialRecursionDepthLimit is introduced, defaulting to 100. Now when a template is evaluated a HandlebarsRuntimeException will be thrown if this limit is reached. This allows the caller to catch the exception and recover gracefully, rather than terminating the process.
closes #566
The path parsing currently doesn't work properly when there are embedded slashes within an ignore block.
This PR fixes this issue:
//
within an escaped block/
to occur within an escape block without breakageBefore, the individual segments between slashes in addition to the entire escaped block were returned by PathInfo. Now, it returns just the latter, which is correct. All existing unit tests still pass and new tests were added to exercise the failing cases in #566.
Closes #568
Resolve the hang on compile when there is an open ignore block
Reshuffle the logic so that the throw check for end of template is done before trying to process the char
@Hoeksema, @RoosterDragon, @StefH, @lahma, @oformaniuk and @thompson-tomo
https://github.com/Handlebars-Net/Handlebars.Net/issues/535
The following line currently throws an OutOfMemoryException for unrecognised expressions: https://github.com/Handlebars-Net/Handlebars.Net/blob/01ad0e69e56331371f85a1c59c008d7ecfd06f78/source/Handlebars/Compiler/Lexer/Parsers/BlockParamsParser.cs#L28
This PR exits the while loop when reaching the end of the end of the string reader.
This pull request demonstrates the the issue experienced in #524
@Nisden, @anth12, @rexm, @zjklee and Anthony Halliday
SharedEnvironment
@zjklee (#514)Introduces SharedEnvironment
to deal with big memory footprint when runtime has a lot of compiled templates.
See SharedEnvironment
documentation for more details
Issues:
FixedSizeDictionary
@zjklee (#512)In rare cases (depended on hashcode
) as part of searching for a suitable place in the array search started from index greater than array length.
Issues:
string
object property access @Dragwar (#510)Removed if
condition in ObjectDescriptor
that checked whether the type is string
Issues:
Split Enumerator strings would have the wrong length if the string started with the separator.
Issues:
@Dragwar, @StefH, @periklis92 and @zjklee
@zjklee
Issues:
SupportLastInObjectIterations
@orgads (#482)Issues:
Issues:
Check loose closing blocks on compile time - fixes #484.
@RomainHautefeuille, @abraham-fox, @orgads, @zjklee
The original issue this PR was intended to solve have been fixed in PR #477. This PR now deals with general rules for encoding in Handlebars.Net vs handlebars.js.
@last
by default. @orgads (#481)Fixes #480
[a/b]
@zjklee (#478)Fixes #470
UnencodedStatementVisitor
resets value to previously existing value when done @tommysor (#477)Fix #468 HandlebarsDotNet.Handlebars.Configuration.NoEscape Applied Inconsistently This PR does not deal with the question of general rules for encoding that was brought up in #473.
Exposed additional helper registration overloads via static methods
@jamesfarrugia96, @orgads, @tommysor, @zjklee