{"record":{"id":"850e513c09674036","repo":"siyuan-note/siyuan","slug":"invalid-builtin-style-id-s","errorCode":null,"errorMessage":"invalid builtin style ID [%s]","messagePattern":"invalid builtin style ID \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/inline_style.go","lineNumber":741,"sourceCode":"\n\t\tlight, dark, err := normalizeInlineStyleThemePair(color.Light, color.Dark, fmt.Sprintf(\"builtin color [%d]\", color.Index))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tret.Colors = append(ret.Colors, &InlineStyleBuiltinColor{Index: color.Index, Light: light, Dark: dark})\n\t}\n\tsort.Slice(ret.Colors, func(i, j int) bool {\n\t\treturn ret.Colors[i].Index < ret.Colors[j].Index\n\t})\n\n\tstyleIDs := make(map[string]struct{}, len(builtin.Styles))\n\tfor _, style := range builtin.Styles {\n\t\tif style == nil {\n\t\t\treturn nil, errors.New(\"builtin style must not be null\")\n\t\t}\n\t\tid := strings.TrimSpace(style.ID)\n\t\tif _, valid := builtinStyleOrder[id]; !valid {\n\t\t\treturn nil, fmt.Errorf(\"invalid builtin style ID [%s]\", id)\n\t\t}\n\t\tif _, exists := styleIDs[id]; exists {\n\t\t\treturn nil, fmt.Errorf(\"duplicate builtin style ID [%s]\", id)\n\t\t}\n\t\tstyleIDs[id] = struct{}{}\n\n\t\tlight, dark, err := normalizeInlineStyleThemePair(style.Light, style.Dark, \"builtin style [\"+id+\"]\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tret.Styles = append(ret.Styles, &InlineStyleBuiltinStyle{ID: id, Light: light, Dark: dark})\n\t}\n\tsort.Slice(ret.Styles, func(i, j int) bool {\n\t\treturn builtinStyleOrder[ret.Styles[i].ID] < builtinStyleOrder[ret.Styles[j].ID]\n\t})\n\n\tif builtin.Hidden != nil {\n\t\tif ret.Hidden.Color, err = normalizeHiddenBuiltinColorIndexes(builtin.Hidden.Color, \"color\"); err != nil {","sourceCodeStart":723,"sourceCodeEnd":759,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/inline_style.go#L723-L759","documentation":"A builtin style entry has an `id` that is not one of the four fixed builtin style IDs. builtinStyleOrder only accepts \"error\", \"warning\", \"info\", and \"success\"; any other ID (including empty after trimming whitespace) is invalid because builtin styles cannot be created or renamed by configuration.","triggerScenarios":"setInlineStylesData or loadInlineStyles with builtin.styles containing `{\"id\": \"caution\", ...}`, `\"id\": \"\"`, or any id other than error/warning/info/success.","commonSituations":"Typo such as \"erorr\" or \"Warning\" (case-sensitive match); attempting to add a custom style in the builtin section instead of the custom inline-styles section; ID trimmed to empty by stray whitespace-only value; schema change across versions.","solutions":["Change the id to one of the exact strings \"error\", \"warning\", \"info\", or \"success\" (lowercase).","If you intended a custom style, move the entry out of builtin.styles into the regular inline styles list, which allows arbitrary IDs.","Remove the entry if it references a builtin style that no longer exists in your kernel version."],"exampleFix":"// before\n{\"id\": \"Warning\", \"light\": {...}, \"dark\": {...}}\n// after\n{\"id\": \"warning\", \"light\": {...}, \"dark\": {...}}","handlingStrategy":"validation","validationCode":"const BUILTIN_IDS = new Set([\"error\", \"warning\", \"info\", \"success\"]);\nfor (const s of config.builtin.styles) {\n  if (!BUILTIN_IDS.has((s.id || \"\").trim())) {\n    throw new Error(`invalid builtin style id: ${s.id}`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Builtin style IDs are a closed, lowercase set: error, warning, info, success — never invent new ones.","Put custom styles in the regular inline styles list, not the builtin section."],"tags":["go","configuration","inline-styles","invalid-enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}