mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
@@ -427,7 +427,7 @@ func TestStringer(t *testing.T) {
|
||||
if err := tmpl.Execute(b, s); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var expect = "string=3"
|
||||
expect := "string=3"
|
||||
if b.String() != expect {
|
||||
t.Errorf("expected %q got %q", expect, b.String())
|
||||
}
|
||||
|
@@ -210,8 +210,10 @@ var cssReplacementTable = []string{
|
||||
'}': `\7d`,
|
||||
}
|
||||
|
||||
var expressionBytes = []byte("expression")
|
||||
var mozBindingBytes = []byte("mozbinding")
|
||||
var (
|
||||
expressionBytes = []byte("expression")
|
||||
mozBindingBytes = []byte("mozbinding")
|
||||
)
|
||||
|
||||
// cssValueFilter allows innocuous CSS values in the output including CSS
|
||||
// quantities (10px or 25%), ID or class literals (#foo, .bar), keyword values
|
||||
|
@@ -891,7 +891,6 @@ func TestEscapeSet(t *testing.T) {
|
||||
t.Errorf("want\n\t%q\ngot\n\t%q", test.want, got)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
@@ -1088,7 +1087,6 @@ func TestErrors(t *testing.T) {
|
||||
// Check that we get the same error if we call Execute again.
|
||||
if err := tmpl.Execute(buf, nil); err == nil || err.Error() != got {
|
||||
t.Errorf("input=%q: unexpected error on second call %q", test.input, err)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -82,7 +82,6 @@ func Example() {
|
||||
// <div><strong>no rows</strong></div>
|
||||
// </body>
|
||||
// </html>
|
||||
|
||||
}
|
||||
|
||||
func Example_autoescaping() {
|
||||
@@ -123,7 +122,6 @@ func Example_escape() {
|
||||
// \"Fran \u0026 Freddie\'s Diner\" \u003Ctasty@example.com\u003E
|
||||
// \"Fran \u0026 Freddie\'s Diner\"32\u003Ctasty@example.com\u003E
|
||||
// %22Fran+%26+Freddie%27s+Diner%2232%3Ctasty%40example.com%3E
|
||||
|
||||
}
|
||||
|
||||
func ExampleTemplate_Delims() {
|
||||
|
@@ -337,6 +337,7 @@ var jsStrNormReplacementTable = []string{
|
||||
'<': `\u003c`,
|
||||
'>': `\u003e`,
|
||||
}
|
||||
|
||||
var jsRegexpReplacementTable = []string{
|
||||
0: `\u0000`,
|
||||
'\t': `\t`,
|
||||
|
@@ -206,7 +206,8 @@ func TestJSStrEscaper(t *testing.T) {
|
||||
{"<!--", `\u003c!--`},
|
||||
{"-->", `--\u003e`},
|
||||
// From https://code.google.com/p/doctype/wiki/ArticleUtf7
|
||||
{"+ADw-script+AD4-alert(1)+ADw-/script+AD4-",
|
||||
{
|
||||
"+ADw-script+AD4-alert(1)+ADw-/script+AD4-",
|
||||
`\u002bADw-script\u002bAD4-alert(1)\u002bADw-\/script\u002bAD4-`,
|
||||
},
|
||||
// Invalid UTF-8 sequence
|
||||
|
@@ -41,8 +41,10 @@ var transitionFunc = [...]func(context, []byte) (context, int){
|
||||
stateError: tError,
|
||||
}
|
||||
|
||||
var commentStart = []byte("<!--")
|
||||
var commentEnd = []byte("-->")
|
||||
var (
|
||||
commentStart = []byte("<!--")
|
||||
commentEnd = []byte("-->")
|
||||
)
|
||||
|
||||
// tText is the context transition function for the text state.
|
||||
func tText(c context, s []byte) (context, int) {
|
||||
|
@@ -42,7 +42,6 @@ func TestFindEndTag(t *testing.T) {
|
||||
}
|
||||
|
||||
func BenchmarkTemplateSpecialTags(b *testing.B) {
|
||||
|
||||
r := struct {
|
||||
Name, Gift string
|
||||
}{"Aunt Mildred", "bone china tea set"}
|
||||
|
Reference in New Issue
Block a user