Skip to main content

keyword_split

Function keyword_split 

Source
pub fn keyword_split(text: &str) -> Option<(&str, &str)>
Expand description

Split a structure heading into its keyword, colon included, and the name that follows, or None when the text names no structure.

The colon alone marks the structure: keywords are localized, so no list of them can name them all. A backtick before the colon does disqualify it though: dialect keywords are one or two plain words, so such a colon is inside a code span rather than behind a keyword.