{"record":{"id":"61e6dda3e4ed36a2","repo":"siyuan-note/siyuan","slug":"do-not-include-markdown-syntax-marker-s","errorCode":null,"errorMessage":"Do not include Markdown syntax marker [%s]","messagePattern":"Do not include Markdown syntax marker \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/bookmark.go","lineNumber":98,"sourceCode":"\t\t\tif err = writeTreeUpsertQueue(tree); err != nil {\n\t\t\t\tutil.ClearPushProgress(100)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tutil.RandomSleep(50, 150)\n\t}\n\n\tindexHistoryDir(filepath.Base(historyDir), util.NewLute())\n\tsql.FlushQueue()\n\n\tutil.ReloadUI()\n\treturn\n}\n\nfunc RenameBookmark(oldBookmark, newBookmark string) (err error) {\n\tif invalidChar := treenode.ContainsMarker(newBookmark); \"\" != invalidChar {\n\t\treturn fmt.Errorf(Conf.Language(112), invalidChar)\n\t}\n\n\tnewBookmark = strings.TrimSpace(newBookmark)\n\tif \"\" == newBookmark {\n\t\treturn errors.New(Conf.Language(126))\n\t}\n\n\tif oldBookmark == newBookmark {\n\t\treturn\n\t}\n\n\tutil.PushEndlessProgress(Conf.Language(110))\n\tdefer util.ClearPushProgress(100)\n\n\tbookmarks := sql.QueryBookmarkBlocks()\n\ttreeBlocks := map[string][]string{}\n\tfor _, bm := range bookmarks {\n\t\tif blocks, ok := treeBlocks[bm.RootID]; !ok {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/afa823b6b4e4f183511e0bc0a3be93caa94c7c97/kernel/model/bookmark.go#L80-L116","documentation":"model.RenameBookmark (POST /api/bookmark/renameBookmark) validates the new name with treenode.ContainsMarker (kernel/treenode/marker.go:24), which rejects ASCII Markdown/LaTeX marker characters: * _ [ ] \\ ! ` < > & ~ $ { } ( ) = # ^. The offending character is returned in the message. Non-ASCII names (e.g. Chinese) always pass because the check applies only to ASCII strings.","triggerScenarios":"renameBookmark with newBookmark such as 'C# notes' (#), 'v2 *draft*' (*), '[inbox]' (brackets), or 'a & b' (&). The marker check runs before the empty-name check.","commonSituations":"Automated bookmark import/merge tools that build names from folder names or tags containing '#', '*', or brackets; using Markdown-ish labels as bookmark names.","solutions":["Strip or replace the marker character reported in the [%s] placeholder","Sanitize bookmark names up front: remove * _ [ ] \\ ! ` < > & ~ $ { } ( ) = # ^ from ASCII input","Use full-width variants or plain words (e.g. 'C♯ notes' or 'C sharp notes') if the symbol matters visually"],"exampleFix":"// before\nrenameBookmark('old', 'C# / [draft]'); // error: marker [#]\n\n// after\nrenameBookmark('old', 'C sharp draft');","handlingStrategy":"validation","validationCode":"const MARKERS = /[*_\\[\\]\\\\!`<>&~${}()=#^]/;\nif (MARKERS.test(newBookmark)) throw new Error('bookmark name contains a Markdown marker');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Sanitize names built from tags, folders, or file names before renaming","Non-ASCII (e.g. Chinese) names bypass the marker check by design","Note the marker check runs before the empty check — fix markers first"],"tags":["bookmark","validation","markdown","api"],"backgroundTag":"invalid-characters","analyzedSha":"afa823b6b4e4f183511e0bc0a3be93caa94c7c97","analyzedAt":"2026-08-18T17:04:10.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}