diff --git a/docs/docs/03-syntax-and-usage/03-attributes.md b/docs/docs/03-syntax-and-usage/03-attributes.md index 8aabd09ce..f2c6b75fd 100644 --- a/docs/docs/03-syntax-and-usage/03-attributes.md +++ b/docs/docs/03-syntax-and-usage/03-attributes.md @@ -225,7 +225,7 @@ templ Button(text string) { ``` ```html title="Output" - - diff --git a/generator/test-js-usage/expected.html b/generator/test-js-usage/expected.html index b81f5d49f..fd433e517 100644 --- a/generator/test-js-usage/expected.html +++ b/generator/test-js-usage/expected.html @@ -1,7 +1,7 @@ - ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/generator/test-once/expected.html b/generator/test-once/expected.html index 2103bd24a..84eaf7dd9 100644 --- a/generator/test-once/expected.html +++ b/generator/test-once/expected.html @@ -1,4 +1,4 @@ -") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/generator/test-only-scripts/expected.html b/generator/test-only-scripts/expected.html index 7b6e7837c..5072ab8f7 100644 --- a/generator/test-only-scripts/expected.html +++ b/generator/test-only-scripts/expected.html @@ -1,7 +1,7 @@ - - \ No newline at end of file diff --git a/generator/test-raw-elements/expected.html b/generator/test-raw-elements/expected.html index 86b5e3a6b..5b41f2a68 100644 --- a/generator/test-raw-elements/expected.html +++ b/generator/test-raw-elements/expected.html @@ -7,7 +7,7 @@ border: 1px solid black; } -

Hello

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

Hello

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/generator/test-script-inline/expected.html b/generator/test-script-inline/expected.html index ce1ac4d47..88920889c 100644 --- a/generator/test-script-inline/expected.html +++ b/generator/test-script-inline/expected.html @@ -1,20 +1,20 @@ - - - - - - diff --git a/generator/test-script-usage-nonce/expected.html b/generator/test-script-usage-nonce/expected.html index 9f15abc46..b8965181c 100644 --- a/generator/test-script-usage-nonce/expected.html +++ b/generator/test-script-usage-nonce/expected.html @@ -1,4 +1,4 @@ - - diff --git a/generator/test-script-usage/expected.html b/generator/test-script-usage/expected.html index 798af2834..b0dec32c6 100644 --- a/generator/test-script-usage/expected.html +++ b/generator/test-script-usage/expected.html @@ -1,4 +1,4 @@ - - - - diff --git a/js_test.go b/js_test.go index 35cfe8ba2..e77408575 100644 --- a/js_test.go +++ b/js_test.go @@ -68,7 +68,7 @@ func TestJSFuncCall(t *testing.T) { Call: "doSomething()", CallInline: "doSomething()", }, - expectedComponentOutput: ``, + expectedComponentOutput: ``, }, { name: "single argument is supported", @@ -80,7 +80,7 @@ func TestJSFuncCall(t *testing.T) { Call: "alert("hello")", CallInline: `alert("hello")`, }, - expectedComponentOutput: ``, + expectedComponentOutput: ``, }, { name: "multiple arguments are supported", @@ -92,7 +92,7 @@ func TestJSFuncCall(t *testing.T) { Call: "console.log("hello","world")", CallInline: `console.log("hello","world")`, }, - expectedComponentOutput: ``, + expectedComponentOutput: ``, }, { name: "attribute injection fails", @@ -104,7 +104,7 @@ func TestJSFuncCall(t *testing.T) { Call: "__templ_invalid_js_function_name()", CallInline: "__templ_invalid_js_function_name()", }, - expectedComponentOutput: ``, + expectedComponentOutput: ``, }, { name: "closing the script and injecting HTML fails", @@ -116,7 +116,7 @@ func TestJSFuncCall(t *testing.T) { Call: "__templ_invalid_js_function_name()", CallInline: "__templ_invalid_js_function_name()", }, - expectedComponentOutput: ``, + expectedComponentOutput: ``, }, } for _, tt := range tests { diff --git a/scripttemplate.go b/scripttemplate.go index 9603cc84a..0aafa0b38 100644 --- a/scripttemplate.go +++ b/scripttemplate.go @@ -49,7 +49,7 @@ func writeScriptHeader(ctx context.Context, w io.Writer) (err error) { if nonce := GetNonce(ctx); nonce != "" { nonceAttr = " nonce=\"" + EscapeString(nonce) + "\"" } - _, err = fmt.Fprintf(w, ``, + expected: ``, }, { name: "if something outside the expected is ignored, if has no effect", @@ -39,13 +39,13 @@ func TestRenderScriptItems(t *testing.T) { }, }, toRender: []templ.ComponentScript{s1, s2}, - expected: ``, + expected: ``, }, { name: "if one is ignored, it's not rendered", toIgnore: []templ.ComponentScript{s1}, toRender: []templ.ComponentScript{s1, s2}, - expected: ``, + expected: ``, }, { name: "if all are ignored, not even style tags are rendered",