mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
@@ -46,13 +46,16 @@ func init() {
|
||||
[][2]string{
|
||||
{
|
||||
`{{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | safeHTML}}`,
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
|
||||
},
|
||||
{
|
||||
`{{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>"}}`,
|
||||
`Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;`},
|
||||
`Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;`,
|
||||
},
|
||||
{
|
||||
`{{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | htmlUnescape | safeHTML }}`,
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -61,16 +64,20 @@ func init() {
|
||||
[][2]string{
|
||||
{
|
||||
`{{ htmlUnescape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | safeHTML}}`,
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
|
||||
},
|
||||
{
|
||||
`{{"Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;" | htmlUnescape | htmlUnescape | safeHTML}}`,
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
|
||||
},
|
||||
{
|
||||
`{{"Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;" | htmlUnescape | htmlUnescape }}`,
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
|
||||
},
|
||||
{
|
||||
`{{ htmlUnescape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | htmlEscape | safeHTML }}`,
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
|
||||
`Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -104,7 +111,6 @@ func init() {
|
||||
)
|
||||
|
||||
return ns
|
||||
|
||||
}
|
||||
|
||||
internal.AddTemplateFuncsNamespace(f)
|
||||
|
@@ -107,7 +107,6 @@ title: Test Metadata
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestRemarshalComments(t *testing.T) {
|
||||
@@ -168,7 +167,6 @@ func TestTestRemarshalError(t *testing.T) {
|
||||
|
||||
_, err = ns.Remarshal("json", "asdf")
|
||||
c.Assert(err, qt.Not(qt.IsNil))
|
||||
|
||||
}
|
||||
|
||||
func TestTestRemarshalMapInput(t *testing.T) {
|
||||
|
@@ -98,7 +98,6 @@ func (ns *Namespace) Markdownify(s interface{}) (template.HTML, error) {
|
||||
}
|
||||
|
||||
b, err := ns.deps.ContentSpec.RenderMarkdown([]byte(ss))
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
@@ -15,7 +15,6 @@ package transform
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
|
||||
"testing"
|
||||
|
||||
"github.com/gohugoio/hugo/common/loggers"
|
||||
@@ -206,7 +205,6 @@ And then some.
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(result, qt.Equals, template.HTML(
|
||||
"<p>#First</p>\n<p>This is some <em>bold</em> text.</p>\n<h2 id=\"second\">Second</h2>\n<p>This is some more text.</p>\n<p>And then some.</p>\n"))
|
||||
|
||||
}
|
||||
|
||||
func TestPlainify(t *testing.T) {
|
||||
|
@@ -39,7 +39,7 @@ func (ns *Namespace) Unmarshal(args ...interface{}) (interface{}, error) {
|
||||
}
|
||||
|
||||
var data interface{}
|
||||
var decoder = metadecoders.Default
|
||||
decoder := metadecoders.Default
|
||||
|
||||
if len(args) == 1 {
|
||||
data = args[0]
|
||||
|
@@ -79,7 +79,6 @@ func (t testContentResource) Key() string {
|
||||
}
|
||||
|
||||
func TestUnmarshal(t *testing.T) {
|
||||
|
||||
v := viper.New()
|
||||
ns := New(newDeps(v))
|
||||
c := qt.New(t)
|
||||
@@ -120,21 +119,17 @@ func TestUnmarshal(t *testing.T) {
|
||||
}},
|
||||
{testContentResource{key: "r1", content: `a;b;c`, mime: media.CSVType}, map[string]interface{}{"delimiter": ";"}, func(r [][]string) {
|
||||
c.Assert([][]string{{"a", "b", "c"}}, qt.DeepEquals, r)
|
||||
|
||||
}},
|
||||
{"a,b,c", nil, func(r [][]string) {
|
||||
c.Assert([][]string{{"a", "b", "c"}}, qt.DeepEquals, r)
|
||||
|
||||
}},
|
||||
{"a;b;c", map[string]interface{}{"delimiter": ";"}, func(r [][]string) {
|
||||
c.Assert([][]string{{"a", "b", "c"}}, qt.DeepEquals, r)
|
||||
|
||||
}},
|
||||
{testContentResource{key: "r1", content: `
|
||||
% This is a comment
|
||||
a;b;c`, mime: media.CSVType}, map[string]interface{}{"DElimiter": ";", "Comment": "%"}, func(r [][]string) {
|
||||
c.Assert([][]string{{"a", "b", "c"}}, qt.DeepEquals, r)
|
||||
|
||||
}},
|
||||
// errors
|
||||
{"thisisnotavaliddataformat", nil, false},
|
||||
|
Reference in New Issue
Block a user