@@ -17,7 +17,6 @@ import (
1717var INTERNAL_IMPORTS = fmt .Sprintf ("import {\n %s\n } from \" %s\" ;\n " , strings .Join ([]string {
1818 FRAGMENT ,
1919 "render as " + TEMPLATE_TAG ,
20- "renderHead as " + RENDER_HEAD ,
2120 "createAstro as " + CREATE_ASTRO ,
2221 "createComponent as " + CREATE_COMPONENT ,
2322 "renderComponent as " + RENDER_COMPONENT ,
@@ -43,7 +42,7 @@ var STYLE_SUFFIX = "];\nfor (const STYLE of STYLES) $$result.styles.add(STYLE);\
4342var SCRIPT_PRELUDE = "const SCRIPTS = [\n "
4443var SCRIPT_SUFFIX = "];\n for (const SCRIPT of SCRIPTS) $$result.scripts.add(SCRIPT);\n "
4544var CREATE_ASTRO_CALL = "const $$Astro = $$createAstro(import.meta.url, 'https://astro.build', '.');\n const Astro = $$Astro;"
46- var RENDER_HEAD_RESULT = fmt . Sprintf ( "${%s(%s)}" , RENDER_HEAD , RESULT )
45+ var RENDER_HEAD_RESULT = "<!--astro:head-->"
4746
4847// SPECIAL TEST FIXTURES
4948var NON_WHITESPACE_CHARS = []byte ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[];:'\" ,.?" )
@@ -98,7 +97,7 @@ func TestPrinter(t *testing.T) {
9897 name : "basic renderHead" ,
9998 source : `<html><head><title>Ah</title></head></html>` ,
10099 want : want {
101- code : `<html><head><title>Ah</title>${$$renderHead($$result)} </head></html>` ,
100+ code : `<html><head><title>Ah</title>` + RENDER_HEAD_RESULT + ` </head></html>` ,
102101 },
103102 },
104103 {
@@ -953,7 +952,7 @@ ${$$renderComponent($$result,'my-element','my-element',{"client:load":true,"clie
953952 name : "Self-closing title II" ,
954953 source : `<html><head><title /></head><body></body></html>` ,
955954 want : want {
956- code : `<html><head><title></title>${$$renderHead($$result)} </head><body></body></html>` ,
955+ code : `<html><head><title></title>` + RENDER_HEAD_RESULT + ` </head><body></body></html>` ,
957956 },
958957 },
959958 {
@@ -1755,7 +1754,7 @@ const items = ["Dog", "Cat", "Platipus"];
17551754 transform .ExtractStyles (doc )
17561755 transform .Transform (doc , transform.TransformOptions {Scope : hash }) // note: we want to test Transform in context here, but more advanced cases could be tested separately
17571756 result := PrintToJS (code , doc , 0 , transform.TransformOptions {
1758- Scope : "astro- XXXX" ,
1757+ Scope : "XXXX" ,
17591758 Site : "https://astro.build" ,
17601759 InternalURL : "http://localhost:3000/" ,
17611760 ProjectRoot : "." ,
0 commit comments