{"record":{"id":"bcec4d4c03e42653","repo":"siyuan-note/siyuan","slug":"invalid-hidden-builtin-style-id-s","errorCode":null,"errorMessage":"invalid hidden builtin style ID [%s]","messagePattern":"invalid hidden builtin style ID \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/inline_style.go","lineNumber":839,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"hidden builtin %s index [%d] must be between %d and %d\", field, index,\n\t\t\t\tminBuiltinColorIndex, maxIndex)\n\t\t}\n\t\tif _, exists := seen[index]; exists {\n\t\t\tcontinue\n\t\t}\n\t\tseen[index] = struct{}{}\n\t\tret = append(ret, index)\n\t}\n\tsort.Ints(ret)\n\treturn ret, nil\n}\n\nfunc normalizeHiddenBuiltinStyleIDs(ids []string) (ret []string, err error) {\n\tseen := make(map[string]struct{}, len(ids))\n\tfor _, value := range ids {\n\t\tid := strings.TrimSpace(value)\n\t\tif _, valid := builtinStyleOrder[id]; !valid {\n\t\t\treturn nil, fmt.Errorf(\"invalid hidden builtin style ID [%s]\", id)\n\t\t}\n\t\tif _, exists := seen[id]; exists {\n\t\t\tcontinue\n\t\t}\n\t\tseen[id] = struct{}{}\n\t\tret = append(ret, id)\n\t}\n\tsort.Slice(ret, func(i, j int) bool {\n\t\treturn builtinStyleOrder[ret[i]] < builtinStyleOrder[ret[j]]\n\t})\n\treturn ret, nil\n}\n\nfunc normalizeInlineStyleTheme(theme *InlineStyleTheme) (ret *InlineStyleTheme, err error) {\n\tret = &InlineStyleTheme{}\n\tif ret.Color, err = normalizeInlineStyleColor(theme.Color); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid color: %w\", err)\n\t}","sourceCodeStart":821,"sourceCodeEnd":857,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/inline_style.go#L821-L857","documentation":"Hidden builtin style IDs must each match a known entry in builtinStyleOrder. Any value that is empty after trimming, misspelled, or belongs to an older/renamed style set is rejected with this error so the hidden-styles configuration only references real builtin styles.","triggerScenarios":"Saving the configuration listing hidden builtin styles with an ID not present in builtinStyleOrder — e.g. a typo, an empty string, or an ID from a previous version whose builtin styles were renamed or removed.","commonSituations":"Manual edits to conf.json; configs copied between workspaces/versions where the builtin style list changed; plugins writing style IDs from their own hardcoded lists.","solutions":["Use only IDs that appear in the current builtinStyleOrder list (check the builtin style names shown in the editor style menu)","Remove or correct the offending ID in the hidden builtin style IDs configuration","If upgrading from an older version, drop the stale IDs and re-hide styles via the UI"],"exampleFix":"// before\nhiddenBuiltinStyleIDs: [\"bold\", \"itallic\"]\n// after\nhiddenBuiltinStyleIDs: [\"bold\", \"italic\"]","handlingStrategy":"validation","validationCode":"function validHiddenStyleIDs(ids, known) {\n  return ids.every(id => known.includes(id.trim()) && id.trim() !== \"\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Source style IDs from the builtin style list, not free text","Trim and deduplicate before saving","After upgrades, intersect the saved list with the current builtinStyleOrder set"],"tags":["configuration","validation","identifier","style"],"backgroundTag":"invalid-identifier","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}