internal/graph/builder.go
@@ -1,6 +1,9 @@ package graph import ( "path/filepath" "strings" "github.com/aisim/kb-cli/internal/vault" ) @@ -92,5 +95,11 @@ } // 匹配文件名(不含扩展名和编号前缀) // 例如:[[充装规格配置]] 匹配 "知识/002-充装规格配置.md" return false // 简化版,后续可扩展 base := filepath.Base(node.Path) base = strings.TrimSuffix(base, ".md") // 去掉编号前缀(如 "002-") if idx := strings.Index(base, "-"); idx >= 0 { base = base[idx+1:] } return base == link || node.Title == link }