siyuan-note/siyuan · error

Do not include Markdown syntax marker [%s]

Error message

Do not include Markdown syntax marker [%s]

What it means

RenameTag checks the new label first with treenode.ContainsMarker; if it returns a Markdown syntax marker character, i18n key 112 ('Do not include Markdown syntax marker [%s]') is returned with the offending character. Tag labels are written into documents as '#tag' text, so marker characters would corrupt rendering; this validation runs before any trimming and before any SQL or tree work.

Source

Thrown at kernel/model/tag.go:128

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

	reloadTreeIDs = gulu.Str.RemoveDuplicatedElem(reloadTreeIDs)
	for _, id := range reloadTreeIDs {
		ReloadProtyle(id)
	}

	updateAttributeViewBlockText(updateNodes)

	sql.FlushQueue()
	util.PushClearProgress()
	return
}

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

	newLabel = strings.TrimPrefix(newLabel, "/")
	newLabel = strings.TrimSuffix(newLabel, "/")
	newLabel = strings.TrimSpace(newLabel)

	if "" == newLabel {
		return errors.New(Conf.Language(114))
	}

	if oldLabel == newLabel {
		return
	}

	util.PushEndlessProgress(Conf.Language(110))
	util.RandomSleep(500, 1000)

	tags := sql.QueryTagSpansByLabel(oldLabel)

View on GitHub (pinned to afa823b6b4)

Solutions

  1. Remove the reported marker character from the new label and retry
  2. Keep tags to plain words, CJK, digits and safe separators like '-'

Example fix

// before
model.RenameTag("work", "#work-urgent**")
// after
model.RenameTag("work", "work-urgent")
Defensive patterns

Strategy: validation

Validate before calling

func hasNoMarkdownMarkers(label string) bool {
	return treenode.ContainsMarker(label) == ""
}

if !hasNoMarkdownMarkers(newLabel) {
	return fmt.Errorf("label %q contains Markdown marker characters", newLabel)
}
model.RenameTag(oldLabel, newLabel)

Type guard

func hasNoMarkdownMarkers(label string) bool {
	return treenode.ContainsMarker(label) == ""
}

Prevention

When it happens

Trigger: Renaming a tag to a label containing Markdown marker characters (such as #, *, _, ~, [, ]) via /api/tag/renameTag or the tag panel.

Common situations: Trying to style a tag like '**important**'; adding a '#' prefix; pasting formatted text into the rename dialog.

Related errors


AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18). Data as JSON: /api/errors/dd9d5fe6df00d1b6. Report an issue: GitHub.