Merge pull request #870 from Arthur-Milchior/trim_start_field_name
Trim the start of field name if it is #, /, ^ or a whitespace
This commit is contained in:
commit
b8a96d81f8
@ -42,7 +42,8 @@ impl NoteField {
|
||||
self.name = self.name.replace(bad_chars, "");
|
||||
}
|
||||
// and leading/trailing whitespace
|
||||
let trimmed = self.name.trim();
|
||||
let bad_start_chars = |c: char| c == '#' || c == '/' || c == '^' || c.is_whitespace();
|
||||
let trimmed = self.name.trim().trim_start_matches(bad_start_chars);
|
||||
if trimmed.len() != self.name.len() {
|
||||
self.name = trimmed.into();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user