Skip to main content

flatten_mrkdwn

Function flatten_mrkdwn 

Source
pub fn flatten_mrkdwn<S: BuildHasher>(
    text: &str,
    names: &HashMap<String, String, S>,
    limit: usize,
) -> String
Expand description

The prose a message reads as when a card quotes it: Slack’s mrkdwn is flattened - a mention is @name from names (the bare id when it cannot be named), a link its label or address, and *text* its text. A token this does not understand is left exactly as written. Flattening stops once limit non-space characters have been emitted, which is enough for the excerpt bound; a single long token still scans the text after the bound.