Fix issues from Inheritance spec (#36)

* Separate inheritance block and expansion

* Catch top level partial definition, and block newlines

* Add testTrailingNewLines to verify output of trailing newlines in partials

* Remove comment

* If block,partial has indentation add indent for first line

* Re-enable full sections spec

* withBlockExpansion

* Get indentation of blocks correct
This commit is contained in:
Adam Fowler
2024-07-15 09:36:15 +01:00
committed by GitHub
parent cc0eaffa06
commit 7689de0a42
6 changed files with 215 additions and 45 deletions

View File

@@ -38,7 +38,8 @@ public struct MustacheTemplate: Sendable {
case unescapedVariable(name: String, transforms: [String] = [])
case section(name: String, transforms: [String] = [], template: MustacheTemplate)
case invertedSection(name: String, transforms: [String] = [], template: MustacheTemplate)
case inheritedSection(name: String, template: MustacheTemplate)
case blockDefinition(name: String, template: MustacheTemplate)
case blockExpansion(name: String, default: MustacheTemplate, indentation: String?)
case partial(String, indentation: String?, inherits: [String: MustacheTemplate]?)
case contentType(MustacheContentType)
}