fixed pongo module version
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
2022-02-28 11:43:47 +01:00
parent fc4eb98b69
commit 0683e327c9
76 changed files with 38 additions and 7123 deletions

View File

@@ -8,7 +8,7 @@ import (
"gitbase.de/apairon/mark2web/pkg/logger"
"gitbase.de/apairon/mark2web/pkg/mark2web"
"github.com/ddliu/motto"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
_ "github.com/robertkrimen/otto/underscore"
)

View File

@@ -2,7 +2,7 @@ package filter
import (
"github.com/davecgh/go-spew/spew"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
)
// DumpFilter is a pongo2 filter, which returns a spew.Dump of the input

View File

@@ -5,7 +5,7 @@ import (
"github.com/davecgh/go-spew/spew"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
. "github.com/smartystreets/goconvey/convey"
)

View File

@@ -20,7 +20,7 @@ import (
"gitbase.de/apairon/mark2web/pkg/mark2web"
"gitbase.de/apairon/mark2web/pkg/webrequest"
"github.com/disintegration/imaging"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
)
func parseImageParams(str string) (*mark2web.ImagingConfig, error) {
@@ -211,9 +211,9 @@ func ImageProcessFilter(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *
}
} else {
out, err := os.Create(imgTarget)
logger.Eexit(err, "filter:image_resize, could not create image file '%s'", imgTarget)
defer out.Close()
logger.Eexit(err, "filter:image_resize, could not create image file '%s'", imgTarget)
switch p.Format {
case "jpeg", "jpg":
var jpegOpt *jpeg.Options

View File

@@ -7,7 +7,7 @@ import (
"gitbase.de/apairon/mark2web/pkg/jobm"
"gitbase.de/apairon/mark2web/pkg/mark2web"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
. "github.com/smartystreets/goconvey/convey"
)

View File

@@ -1,18 +1,18 @@
package filter
import (
"github.com/flosch/pongo2"
_ "github.com/flosch/pongo2-addons"
"github.com/flosch/pongo2/v4"
)
func init() {
err := pongo2.ReplaceFilter("markdown", MarkdownFilter)
// if err != nil {
// err = pongo2.RegisterFilter("markdown", MarkdownFilter)
if err != nil {
err = pongo2.RegisterFilter("markdown", MarkdownFilter)
if err != nil {
panic(err)
}
panic(err)
}
// }
newFilters := map[string]pongo2.FilterFunction{
"image_process": ImageProcessFilter,

View File

@@ -4,7 +4,7 @@ import (
"encoding/json"
"strings"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
)
// JSONFilter is a pongo2 filter, which returns a json string of the input

View File

@@ -4,7 +4,7 @@ import (
"math"
"testing"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
. "github.com/smartystreets/goconvey/convey"
)

View File

@@ -5,7 +5,7 @@ import (
"strings"
"gitbase.de/apairon/mark2web/pkg/helper"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
)
// MarkdownFilter is a pongo2 filter, which converts markdown to html

View File

@@ -3,7 +3,7 @@ package filter
import (
"testing"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
. "github.com/smartystreets/goconvey/convey"
)

View File

@@ -2,7 +2,7 @@ package filter
import (
"gitbase.de/apairon/mark2web/pkg/mark2web"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
)
// RelativePathFilter returns the relative path to navpoint based on current nav

View File

@@ -5,7 +5,7 @@ import (
"gitbase.de/apairon/mark2web/pkg/mark2web"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
. "github.com/smartystreets/goconvey/convey"
)

View File

@@ -10,7 +10,7 @@ import (
"gitbase.de/apairon/mark2web/pkg/logger"
"gitbase.de/apairon/mark2web/pkg/webrequest"
"github.com/davecgh/go-spew/spew"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
)
type colCacheEntry struct {

View File

@@ -12,7 +12,7 @@ import (
"gitbase.de/apairon/mark2web/pkg/helper"
"gitbase.de/apairon/mark2web/pkg/logger"
"github.com/davecgh/go-spew/spew"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
cpy "github.com/otiai10/copy"
"gopkg.in/yaml.v2"
)
@@ -72,7 +72,7 @@ func (node *TreeNode) processMarkdownWithHeader(md []byte, errorRef string) (*Pa
newConfig := new(PathConfig)
headerRegex := regexp.MustCompile(`(?s)^---(.*?)\r?\n\r?---\r?\\n\r?`)
headerRegex := regexp.MustCompile("(?s)^---(.*?)\\r?\\n\\r?---\\r?\\n\\r?")
yamlData := headerRegex.Find(md)
if string(yamlData) != "" {
// replace tabs
@@ -95,7 +95,7 @@ func (node *TreeNode) processMarkdownWithHeader(md []byte, errorRef string) (*Pa
}
// use --- for splitting document in markdown parts
regex := regexp.MustCompile(`\r?\n\r?---\r?\n\r?`)
regex := regexp.MustCompile("\\r?\\n\\r?---\\r?\\n\\r?")
inputParts := regex.Split(string(md), -1)
htmlParts := make([]*pongo2.Value, 0)

View File

@@ -13,7 +13,7 @@ import (
"gitbase.de/apairon/mark2web/pkg/progress"
"github.com/davecgh/go-spew/spew"
"github.com/extemporalgenome/slug"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
"gopkg.in/yaml.v2"
)

View File

@@ -2,7 +2,7 @@ package mark2web
import (
"gitbase.de/apairon/mark2web/pkg/webrequest"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
)
// RequestFn will make a web request and returns map[string]interface form pongo2

View File

@@ -3,7 +3,7 @@ package mark2web
import (
"log"
"github.com/flosch/pongo2"
"github.com/flosch/pongo2/v4"
)
var templateCache = make(map[string]*pongo2.Template)