Add support for custom text escaping (#11)
* Add support for custom text escaping * swift format * Remove withDefaultDelimiters * Update README.md * Don't pass content type into partial
This commit is contained in:
@@ -92,6 +92,13 @@ final class TemplateRendererTests: XCTestCase {
|
||||
XCTAssertEqual(template.render(Test(test: .init(string: "sub"))), "test sub")
|
||||
}
|
||||
|
||||
func testTextEscaping() throws {
|
||||
let template1 = try HBMustacheTemplate(string: "{{% CONTENT_TYPE:TEXT}}{{.}}")
|
||||
XCTAssertEqual(template1.render("<>"), "<>")
|
||||
let template2 = try HBMustacheTemplate(string: "{{% CONTENT_TYPE:HTML}}{{.}}")
|
||||
XCTAssertEqual(template2.render("<>"), "<>")
|
||||
}
|
||||
|
||||
/// variables
|
||||
func testMustacheManualExample1() throws {
|
||||
let template = try HBMustacheTemplate(string: """
|
||||
|
||||
Reference in New Issue
Block a user