~exprez135/castor

2210b43c047d8c7d346ca35d6549e4f93902618d — Julien Blanchard 11 months ago f389137
[gopher] don't crash on schemes in text

"gemini:// " was crashing the link discovery
1 files changed, 6 insertions(+), 2 deletions(-)

M src/gopher/link.rs
M src/gopher/link.rs => src/gopher/link.rs +6 -2
@@ 203,6 203,10 @@ pub fn make_link(url: String, label: String) -> Option<Link> {
fn extract_url(line: &str) -> &str {
    let finder = LinkFinder::new();
    let links: Vec<_> = finder.links(line).collect();
    let link = &links[0];
    link.as_str()
    if links.is_empty() {
        line
    } else {
        let link = &links[0];
        link.as_str()
    }
}