Skip to main content

split_alt_width

Function split_alt_width 

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

Split pipe-delimited alt/alias text into (remaining, width).

Pulls out the FIRST segment that parse_image_width recognizes; all other segments are rejoined with | in order. If no segment is a width, returns the input unchanged with None. Mirrors the segment model of extract_width_from_alias but for the image width vocabulary (named + percent).