@@ -71,14 +71,14 @@ test("expandImports throws on missing file", async () => {
7171test ( "expandImports executes command inline" , async ( ) => {
7272 const content = "Output: !`echo hello`" ;
7373 const result = await expandImports ( content , testDir ) ;
74- // Command output is wrapped in {% raw %} to prevent LiquidJS template interpretation
75- expect ( result ) . toBe ( "Output: {% raw %}\nhello\n{% endraw %} " ) ;
74+ // Command output is returned directly (Phase 3 runs after LiquidJS)
75+ expect ( result ) . toBe ( "Output: hello " ) ;
7676} ) ;
7777
7878test ( "expandImports handles command with arguments" , async ( ) => {
7979 const content = "!`echo one two three`" ;
8080 const result = await expandImports ( content , testDir ) ;
81- expect ( result ) . toBe ( "{% raw %}\none two three\n{% endraw %}" )
81+ expect ( result ) . toBe ( "one two three" ) ;
8282} ) ;
8383
8484test ( "expandImports handles multiple imports" , async ( ) => {
@@ -90,7 +90,7 @@ test("expandImports handles multiple imports", async () => {
9090test ( "expandImports handles mixed file and command" , async ( ) => {
9191 const content = "File: @./simple.md Command: !`echo test`" ;
9292 const result = await expandImports ( content , testDir ) ;
93- expect ( result ) . toBe ( "File: Hello from simple.md Command: {% raw %}\ntest\n{% endraw %} " ) ;
93+ expect ( result ) . toBe ( "File: Hello from simple.md Command: test " ) ;
9494} ) ;
9595
9696test ( "expandImports preserves content without imports" , async ( ) => {
@@ -525,15 +525,15 @@ describe("template variables in commands", () => {
525525 expect ( result ) . toContain ( "piped-content" ) ;
526526 } ) ;
527527
528- test ( "protects command output from template interpretation" , async ( ) => {
529- // Command outputs {{ foo }} - should be wrapped in {% raw %} and not interpreted
528+ test ( "command output is returned directly (Phase 3 runs after LiquidJS)" , async ( ) => {
529+ // Command output containing template-like syntax is returned as-is
530+ // (no wrapping needed since commands run after template processing)
530531 const content = "!`echo '{{ output }}'`" ;
531532 const result = await expandImports ( content , testDir , new Set ( ) , false , {
532533 templateVars : { } ,
533534 } ) ;
534- // Output should be wrapped in {% raw %}...{% endraw %}
535- expect ( result ) . toContain ( "{% raw %}" ) ;
536- expect ( result ) . toContain ( "{% endraw %}" ) ;
535+ // Output should contain the literal {{ output }} text
536+ expect ( result ) . toContain ( "{{ output }}" ) ;
537537 } ) ;
538538} ) ;
539539
@@ -651,7 +651,6 @@ describe("executable code fences", () => {
651651 const content = '```sh\n#!/bin/bash\necho "hello from bash"\n```' ;
652652 const result = await expandImports ( content , testDir ) ;
653653 expect ( result ) . toContain ( "hello from bash" ) ;
654- expect ( result ) . toContain ( "{% raw %}" ) ;
655654 } ) ;
656655
657656 test ( "executes bun/typescript code fence with shebang" , async ( ) => {
@@ -672,13 +671,12 @@ describe("executable code fences", () => {
672671 await expect ( expandImports ( content , testDir ) ) . rejects . toThrow ( "Code fence failed" ) ;
673672 } ) ;
674673
675- test ( "code fence output is wrapped in raw block " , async ( ) => {
674+ test ( "code fence output is returned directly (Phase 3 runs after LiquidJS) " , async ( ) => {
676675 const content = '```sh\n#!/bin/bash\necho "{{ template syntax }}"\n```' ;
677676 const result = await expandImports ( content , testDir ) ;
678- // Output should be protected from LiquidJS interpretation
679- expect ( result ) . toContain ( "{% raw %}" ) ;
680- expect ( result ) . toContain ( "{% endraw %}" ) ;
677+ // Output returned as-is (no wrapping needed since code fences run after template processing)
681678 expect ( result ) . toContain ( "{{ template syntax }}" ) ;
679+ expect ( result ) . not . toContain ( "{% raw %}" ) ;
682680 } ) ;
683681
684682 test ( "respects dry-run mode for code fences" , async ( ) => {
0 commit comments