fn can_merge(class1: Option<Class>, class2: Option<Class>, text: &str) -> boolExpand description
Check if two Class can be merged together. In the following rules, “unclassified” means None
basically (since it’s Option<Class>). The following rules apply:
- If two
Classhave the same variant, then they can be merged. - If the other
Classis unclassified and only contains white characters (backline, whitespace, etc), it can be merged. Class::Identis considered the same as unclassified (because it doesn’t have an associated CSS class).