siyuan-note/siyuan · warning

Conf.Language(112)

Error message

Conf.Language(112)

What it means

RenameBookmark validates the new bookmark name before applying it. If the name contains characters that SiYuan reserves for block-mark syntax (detected by treenode.ContainsMarker), the rename is rejected with a localized message (language key 112) naming the offending character. Bookmark names are used in queries/menus so marker characters are forbidden.

Solutions

  1. Remove the reserved marker characters from the new name (shown in the error message)
  2. Sanitize input with a replacement character before calling, e.g. replace '/' with '-'
  3. Show the localized error to the user and prompt for a different name

Example fix

// before
err := model.RenameBookmark(old, input) // input: "work/project"
// after
sanitized := strings.ReplaceAll(input, "/", "-")
if c := treenode.ContainsMarker(sanitized); c != "" { return fmt.Errorf("invalid char %q", c) }
err := model.RenameBookmark(old, sanitized)
Defensive patterns

Strategy: validation

Validate before calling

if c := treenode.ContainsMarker(newName); c != "" { return fmt.Errorf("bookmark name may not contain %q", c) }

Try / catch

if err := model.RenameBookmark(old, name); err != nil {
  // surface localized message to user and keep old name
}

Prevention

When it happens

Trigger: Calling RenameBookmark (or the bookmarkRename API) where `newBookmark` contains a marker character such as /, ^, or other Kramdown-reserved tokens used in block refs and search syntax.

Common situations: User pastes a path-like or markup-flavored name (e.g. 'work/project', '^todo') into the rename dialog; programmatic renames built from filenames or headings that include slashes.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/e0cb6fa1bfa1a6e8. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/bookmark.go:100

			if err = writeTreeUpsertQueue(tree); err != nil {
				util.ClearPushProgress(100)
				return
			}
		}

		util.RandomSleep(50, 150)
	}

	indexHistoryDir(filepath.Base(historyDir), util.NewLute())
	sql.FlushQueue()

	util.ReloadUI()
	return
}

func RenameBookmark(oldBookmark, newBookmark string) (err error) {
	if invalidChar := treenode.ContainsMarker(newBookmark); "" != invalidChar {
		return fmt.Errorf(Conf.Language(112), invalidChar)
	}

	newBookmark = strings.TrimSpace(newBookmark)
	if "" == newBookmark {
		return errors.New(Conf.Language(126))
	}

	if oldBookmark == newBookmark {
		return
	}

	util.PushEndlessProgress(Conf.Language(110))
	defer util.ClearPushProgress(100)

	bookmarks := sql.QueryBookmarkBlocks()
	treeBlocks := map[string][]string{}
	for _, bm := range bookmarks {
		if blocks, ok := treeBlocks[bm.RootID]; !ok {

View on GitHub (pinned to 9f775e8a12)