{"record":{"id":"2f019b45e7a1c2ed","repo":"siyuan-note/siyuan","slug":"conf-language-112-invalidchar","errorCode":null,"errorMessage":"Conf.Language(112) {invalidChar}","messagePattern":"Conf\\.Language\\(112\\) (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/tag.go","lineNumber":128,"sourceCode":"\n\tindexHistoryDir(filepath.Base(historyDir), util.NewLute())\n\tsql.FlushQueue()\n\n\treloadTreeIDs = gulu.Str.RemoveDuplicatedElem(reloadTreeIDs)\n\tfor _, id := range reloadTreeIDs {\n\t\tReloadProtyle(id)\n\t}\n\n\tupdateAttributeViewBlockText(updateNodes)\n\n\tsql.FlushQueue()\n\tutil.PushClearProgress()\n\treturn\n}\n\nfunc RenameTag(oldLabel, newLabel string) (err error) {\n\tif invalidChar := treenode.ContainsMarker(newLabel); \"\" != invalidChar {\n\t\treturn fmt.Errorf(Conf.Language(112), invalidChar)\n\t}\n\n\tnewLabel = strings.TrimPrefix(newLabel, \"/\")\n\tnewLabel = strings.TrimSuffix(newLabel, \"/\")\n\tnewLabel = strings.TrimSpace(newLabel)\n\n\tif \"\" == newLabel {\n\t\treturn errors.New(Conf.Language(114))\n\t}\n\n\tif oldLabel == newLabel {\n\t\treturn\n\t}\n\n\tutil.PushEndlessProgress(Conf.Language(110))\n\tutil.RandomSleep(500, 1000)\n\n\ttags := sql.QueryTagSpansByLabel(oldLabel)","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/tag.go#L110-L146","documentation":"RenameTag calls treenode.ContainsMarker(newLabel); if the new label contains any Markdown block/inline marker character (e.g. #, *, -, >, [, ], `, etc.) it returns fmt.Errorf(Conf.Language(112), invalidChar) = 'Do not include Markdown syntax marker [<char>]'. Tags are stored as text, so marker characters would corrupt parsing or be interpreted as syntax.","triggerScenarios":"POST /api/tag/renameTag (or the MCP tag tool, or CLI `siyuan tag rename`) with a newLabel containing a Markdown marker character. Examples: 'work #1', 'a*b', '-task', '`code`'.","commonSituations":"User prefixes the tag with '#' thinking it denotes a tag. Tag name contains emphasis or list syntax. Importing tags from another tool that allowed '#'.","solutions":["Remove Markdown marker characters from the new tag label.","Drop a leading '#' (tags do not need it); use plain words.","If you need grouping, use '/' path separators (allowed) instead of marker chars."],"exampleFix":"// before: newLabel=\"work #1\" -> error 112 with invalidChar='#'\n// after: newLabel=\"work-1\"","handlingStrategy":"validation","validationCode":"// Go caller\nif c := treenode.ContainsMarker(newLabel); c != \"\" {\n    return fmt.Errorf(\"tag label must not contain markdown marker %q\", c)\n}","typeGuard":"// Go\nfunc tagLabelIsSafe(label string) bool { return treenode.ContainsMarker(label) == \"\" }","tryCatchPattern":null,"preventionTips":["Validate the tag label in the rename UI and strip marker chars.","Do not let users prefix tags with '#' or '*'.","Run ContainsMarker on import paths that ingest external tags."],"tags":["tag","markdown","validation","i18n","kernel"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}