feat(block): Support rendering parent block

This commit is contained in:
Kyle Fuller
2016-12-02 00:59:01 +00:00
parent 49936c36d4
commit d75db241ac
4 changed files with 13 additions and 1 deletions

View File

@@ -109,7 +109,9 @@ class BlockNode : NodeType {
func render(_ context: Context) throws -> String {
if let blockContext = context[BlockContext.contextKey] as? BlockContext, let node = blockContext.pop(name) {
return try node.render(context)
return try context.push(dictionary: ["block": ["super": self]]) {
return try node.render(context)
}
}
return try renderNodes(nodes, context)