Skip to main content

split_terms

Function split_terms 

Source
pub fn split_terms(input: &str) -> Vec<String>
Expand description

Splits a front-matter term list into trimmed, non-empty terms.

Accepts a comma or semicolon, plus the Arabic comma (،), fullwidth comma () and ideographic comma (), so a tag list keeps its terms whatever script it was written in.

§Examples

assert_eq!(ssg_core::split_terms("a, b,c"), vec!["a", "b", "c"]);
// Arabic comma — one list of three, not one term.
assert_eq!(ssg_core::split_terms("أ، ب، ج").len(), 3);
assert!(ssg_core::split_terms(" , ,").is_empty());