-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustomtag.go
More file actions
26 lines (21 loc) · 636 Bytes
/
customtag.go
File metadata and controls
26 lines (21 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
import (
"github.com/flosch/pongo2"
log "github.com/sirupsen/logrus"
)
type Inode struct {
Wrapper *pongo2.NodeWrapper
Parser *pongo2.Parser
}
func (i Inode) Execute(c *pongo2.ExecutionContext, t pongo2.TemplateWriter) *pongo2.Error {
log.Debug("called Executor")
i.Wrapper.Execute(c, t)
return nil
}
// var SkipTag pongo2.TagParser = func () {}
func SkipTag2(doc *pongo2.Parser, start *pongo2.Token, args *pongo2.Parser) (tag pongo2.INodeTag, err *pongo2.Error) {
wrapper, parser, err := doc.WrapUntilTag("endskip")
log.Debug("called")
log.Debug(doc)
return Inode{Wrapper: wrapper, Parser: parser}, nil
}