demo(scql): 修复脚本块 SyntaxError 导致加载示例/运行全部失效
第 275 行模板字符串内嵌字符串字面量少一个右单引号:
fill="${get('--panel-2)}" ❌ 语法错误 → 整个 script 不执行
fill="${get('--panel-2')}" ✅ 修
修复前症状(Playwright 实测):
- pageerror: SyntaxError: Invalid or unexpected token
- 初始 textarea 完全为空(loadExample 未跑)
- 点击「加载示例」无任何反应
- 点击「运行」无反应
修复后实测:
- bank textarea 自动填入 109 字符(10 行示例)
- shop textarea 自动填入 77 字符(9 行示例)
- 点击 #btn-run 后 statTime=77ms / statIntersect=6 / statWhere=3 / statGroup=3
- 无 JS 报错
This commit is contained in:
1 parent
c7435b2048
commit
cf4e207bfb
1 file changed
+1
-1
@@ -272,7 +272,7 @@ function buildFlowSvg() {
|
||||
const bg = n.color === 'alice' ? get('--alice-bg') : n.color === 'bob' ? get('--bob-bg') : get('--panel-2)');
|
||||
const w = 100, h = 36, x0 = n.x - w/2, y0 = n.y - h/2;
|
||||
let sN = `<g class="flow-node" data-id="${id}" data-reveal-stage="${id.includes('1') ? 1 : id.includes('2') ? 2 : id.includes('3') ? (n.color==='bob' ? 4 : 5) : 0}">`;
|
||||
sN += `<rect class="flow-node-bg" x="${x0}" y="${y0}" width="${w}" height="${h}" rx="5" fill="${get('--panel-2)}" stroke="${edge}" stroke-width="1.4"/>`;
|
||||
sN += `<rect class="flow-node-bg" x="${x0}" y="${y0}" width="${w}" height="${h}" rx="5" fill="${get('--panel-2')}" stroke="${edge}" stroke-width="1.4"/>`;
|
||||
sN += `<text x="${n.x}" y="${n.y-3}" text-anchor="middle" class="flow-label" fill="${color}">${escapeHtml(n.label)}</text>`;
|
||||
sN += `<text x="${n.x}" y="${n.y+12}" text-anchor="middle" class="flow-sub">${escapeHtml(n.sub)}</text>`;
|
||||
sN += `</g>`;
|
||||
|
||||
Reference in new issue
Block a user