Skip to main content

slug_of

Function slug_of 

Source
pub fn slug_of(target: &str) -> String
Expand description

The slug in whatever was pasted: a slug already, or a page’s full address.

Query and fragment go, and so do the slashes around the path, which the browser adds and the API does not want. A copied address arrives percent-encoded — every Cyrillic slug does — and is decoded here, or it would be encoded a second time on its way to the API and name no page.