编程大模型始终只是概率回答,并非推理回答

就这么一个小问题,反复折腾和提醒,仍然无法解决

实际上,它真能"懂"吗?------只是一次次碰概率而已。

最后解决问题的是,把检测测试放入浏览器控制台,根据控制台输出,一点点排查,这才解决了问题。(在不写任何代码的情况下,仅依赖过程GLM5.1或DeepseekV4p,解决问题)

bash 复制代码
(function(){
    console.log('========== MermaidFix v8 测试开始 ==========');
    var theme = document.documentElement.getAttribute('data-theme');
    console.log('当前主题:', theme);

    function isWhiteColor(c) {
        if (!c) return false;
        c = c.replace(/\s/g, '');
        return c === 'rgb(255,255,255)' || c === 'rgba(255,255,255,1)' ||
               c === '#fff' || c === '#ffffff' || c === 'white';
    }

    var svgs = document.querySelectorAll('.mermaid svg');
    console.log('找到 SVG 数量:', svgs.length);
    if (!svgs.length) { console.log('!!! 没有SVG !!!'); return; }

    var fixedCount = 0, skippedCount = 0, edgeLabelCount = 0;
    svgs.forEach(function(svg) {
        svg.querySelectorAll('foreignObject').forEach(function(fo) {
            var div = fo.querySelector('div');
            if (!div) return;

            var compColor = window.getComputedStyle(div).color;
            var divStyleColor = div.style.color;
            var isWhite = isWhiteColor(compColor) || isWhiteColor(divStyleColor);

            console.log('fo div: computed=' + compColor + ' style=' + divStyleColor + ' isWhite=' + isWhite);

            if (!isWhite) { skippedCount++; return; }

            fixedCount++;
            fo.querySelectorAll('*').forEach(function(el) {
                el.style.setProperty('color', '#ffffff', 'important');
                el.style.setProperty('-webkit-text-fill-color', '#ffffff', 'important');
            });
        });

        // 连线加深
        svg.querySelectorAll('g.edgePath path').forEach(function(p) {
            p.style.setProperty('stroke', '#64748b', 'important');
        });
        // 边标签深色文字
        svg.querySelectorAll('g.edgeLabel foreignObject *').forEach(function(el) {
            edgeLabelCount++;
            el.style.setProperty('color', '#334155', 'important');
        });
    });

    console.log('========== 结果: 修正 ' + fixedCount + ' 个深色节点, 跳过 ' + skippedCount + ' 个, 边标签 ' + edgeLabelCount + ' 个 ==========');
})();
VM24:2 ========== MermaidFix v8 测试开始 ==========
VM24:4 当前主题: light
VM24:14 找到 SVG 数量: 1
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(51, 51, 51) style= isWhite=false
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(255, 255, 255) style=rgb(255, 255, 255) isWhite=true
VM24:27 fo div: computed=rgb(16, 185, 129) style=rgb(16, 185, 129) isWhite=false
VM24:49 ========== 结果: 修正 15 个深色节点, 跳过 16 个, 边标签 30 个 ==========
undefined
相关推荐
stereohomology19 天前
vibe coding效率高:一个新mcp server已经试运行尚可
大语言模型·mcp·traecn·glm5.1·why不coding