Skip to main content

escape_link_text

Function escape_link_text 

Source
pub fn escape_link_text(text: &str) -> String
Expand description

Escape the link syntax’s own punctuation — \, [, ], (, ) — with a backslash, so a label or URL may contain it. Chords are the reason: ]f, di(, da), ci] are ordinary motions and text objects, and unescaped each one ended the label or the URL early. The parsers (extract_links_and_clean, parse_help_links) unescape.

Every *_link helper applies it; a hand-built [..](..) whose text can contain these characters must too.