[object Object]

← back to Wallco Ai

Fix two more PDP inline-script newline-in-string token errors

6675f7f9c18de5bb57d78cf9714eb90254e1516e · 2026-05-31 17:45:24 -0700 · Steve Abrams

Same \n-collapse class as the mailto fix: literal \n inside single-quoted
strings collapsed to real newlines at template-emit, breaking the whole
inline <script> for all visitors (incl. the hint-TDZ cascade the browser
reported downstream).

- recreate-design confirm() (13826): 'Recreate...?\n\nA NEW SKU...' → \\n
- run-log textContent (16100): j.stderr ? '\n[stderr]\n'+... → \\n

Emitted PDP: 0 real parse failures (remaining flags are comment fragments
containing the literal text '<script>'), 0 TDZ risk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 6675f7f9c18de5bb57d78cf9714eb90254e1516e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun May 31 17:45:24 2026 -0700

    Fix two more PDP inline-script newline-in-string token errors
    
    Same \n-collapse class as the mailto fix: literal \n inside single-quoted
    strings collapsed to real newlines at template-emit, breaking the whole
    inline <script> for all visitors (incl. the hint-TDZ cascade the browser
    reported downstream).
    
    - recreate-design confirm() (13826): 'Recreate...?\n\nA NEW SKU...' → \\n
    - run-log textContent (16100): j.stderr ? '\n[stderr]\n'+... → \\n
    
    Emitted PDP: 0 real parse failures (remaining flags are comment fragments
    containing the literal text '<script>'), 0 TDZ risk.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 server.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server.js b/server.js
index 198da54..59500b9 100644
--- a/server.js
+++ b/server.js
@@ -13823,7 +13823,7 @@ try {
                   if (id_c) combined.push('Interior-designer critique: ' + id_c);
                   combined.push('Apply the above critique to a fresh take on the same subject and palette. Specifically address: visible seams at midline, color harmony / contrast issues called out, and the focal-point / composition feedback. Keep what was praised; fix what was flagged.');
                   var comment = combined.join(' ');
-                  if (!confirm('Recreate this design using the GD + ID critique?\n\nA NEW SKU will be created (parent_design_id = ' + did + '). This costs one ComfyUI generation (~30-90s).')) {
+                  if (!confirm('Recreate this design using the GD + ID critique?\\n\\nA NEW SKU will be created (parent_design_id = ' + did + '). This costs one ComfyUI generation (~30-90s).')) {
                     setStatus('Cancelled.', false);
                     return;
                   }
@@ -16097,7 +16097,7 @@ ${(() => {
             body: JSON.stringify({ force: !!force })
           }).then(function(r){ return r.json(); }).then(function(j){
             btn.disabled = rbn.disabled = false;
-            log.textContent = (j.stdout||'') + (j.stderr ? '\n[stderr]\n'+j.stderr : '');
+            log.textContent = (j.stdout||'') + (j.stderr ? '\\n[stderr]\\n'+j.stderr : '');
             refresh();
           }).catch(function(e){
             btn.disabled = rbn.disabled = false;

← 47df49c Fix two more PDP runtime JS errors (hint TDZ + mailto newlin  ·  back to Wallco Ai  ·  admin/inspirations: pin board header + sort/density controls bc5fdec →