mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-18 00:15:44 +00:00
M14: explain the bookmark name rules in validation errors (#6706)
This commit is contained in:
1 file changed
+3
-1
@@ -188,7 +188,9 @@ pub(super) fn delete_bookmark(s: &mut Session, v: &Value) -> CmdResult {
|
||||
pub(super) fn bookmark(s: &mut Session, v: &Value) -> CmdResult {
|
||||
let name = p::req_str(v, "name")?.trim().to_string();
|
||||
if !bookmark_name_ok(&name) {
|
||||
return Err(CmdError::Params("bookmark names start with a letter, have no spaces and at most 40 characters".into()));
|
||||
return Err(CmdError::Params(
|
||||
"bookmark names start with a letter or underscore, contain only letters, numbers or underscores, and have at most 40 characters".into(),
|
||||
));
|
||||
}
|
||||
// Replace an existing bookmark of the same name.
|
||||
remove_bookmark(s, &name)?;
|
||||
|
||||
Reference in new issue
Block a user