Skip to main content

percent_decode

Function percent_decode 

Source
pub fn percent_decode(s: &str) -> String
Expand description

Percent-decode a markdown link URL. Public for the same reason strip_md_ext is.

ยงExamples

use markdown_link::percent_decode;

assert_eq!(percent_decode("My%20Note"), "My Note");
assert_eq!(percent_decode("%zz"), "%zz"); // not hex, kept as written
assert_eq!(percent_decode("%+5"), "%+5"); // a sign is not a hex digit
assert_eq!(percent_decode("%FF"), "%FF"); // not UTF-8, kept as written