pub fn normalize_path(input: &str) -> StringExpand description
Normalizes a path string by cleaning up dots and empty components.
This function implements the core path normalization logic:
- Empty string “” → empty string (refers to current Doc)
- Leading dots “.user” → “user”
- Trailing dots “user.” → “user”
- Consecutive dots “user..profile” → “user.profile”
- Pure dots “…” → empty string
§Examples
assert_eq!(normalize_path(""), "");
assert_eq!(normalize_path(".user"), "user");
assert_eq!(normalize_path("user."), "user");
assert_eq!(normalize_path("user..profile"), "user.profile");
assert_eq!(normalize_path("..."), "");
assert_eq!(normalize_path("user.profile.name"), "user.profile.name");