Releases: vapor/leaf-kit
Extend for loops with custom index support
This patch was authored by @vzsg and released by @0xTim.
Traditionally, the for
loops in Leaf declare three variables in the loop's local context: isFirst
, isLast
and index
. The first two aren't particularly interesting, but being able to access all indices in a nested for loop situation is sometimes useful when working with two dimensions at once. Not to mention it just popped up on Discord earlier today.
This PR extends Loop with the option of renaming index
.
Example syntax:
#for(i, array in arrays):
#for(j, element in array):
(#(i), #(j)): #(element)
#endfor
#endfor
Should be semver-minor.
Add #dumpContext tag
This patch was authored by @marius-se and released by @0xTim.
Adds a new tag, #dumpContext()
that renders the whole context for easy debugging
Adds a new `#with()` tag to make it easier to embed and extend tags
This patch was authored by @pontaoski and released by @0xTim.
Adds a new #with()
tag to make it easier to work with extend and embed tags:
#with(parent):
#(child)
#endwith
Update Supported Swift Versions
This patch was authored and released by @0xTim.
This removes support for Swift 5.2 and Swift 5.3, making Swift 5.4 the earliest supported version as
announced
Fix warning from compiler issue in Swift 5.6
Ignore unfound import
This patch was authored by @fananek and released by @0xTim.
This makes the renderer and serializer ignore imports in case no corresponding export has been found rather than erroring by default. This also adds a new configuration flag ignoreUnfoundImports
to allow you to set the behaviour to error on non-existent imports
Fixes #84
Fix variable ambiguity
This patch was authored and released by @0xTim.
Fix variable ambiguity in the LeafSerializer introduced in 1.3.0 that causes build failures in some vesions of Swift
1.3.0
UnsafeUnescapedLeafTag
to avoid your rendered strings from escaping. No other changes are required.
This release fixes a potential XSS vulnerability in LeafKit. Before Leaf would render any parameters passed to any tags without escaping any HTML allowing an attacker to inject malicious scripts. All tags built into LeafKit now escape any rendered strings, apart from the new unsafeHTML
tag.
- Introduces a new
unsafeHTML
for rendering parameters you trust that contain HTML you want to leave intact - Introduces
UnsafeUnescapedLeafTag
to conform custom tags to that won't escape any HTML.