Function linkcheck::scanners::plaintext[][src]

pub fn plaintext(src: &str) -> impl Iterator<Item = (&str, Span)> + '_
Expand description

Use the linkify crate to find all URLs in a string of normal text.

Examples

let src = "hello http://localhost/ world. this is file://some/text";

let got: Vec<_> = linkcheck::scanners::plaintext(src).collect();

assert_eq!(got.len(), 2);
let (url, span) = got[0];
assert_eq!(url, "http://localhost/");
assert_eq!(span, Span::new(6, 23));