From 1671a8065b6e17ea3743481e82f091c53e048ad9 Mon Sep 17 00:00:00 2001 From: Artemy Egorov Date: Sun, 4 Aug 2024 17:38:52 +0300 Subject: [PATCH] fix: gemtext parse whitespace in links --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/parsers/gemtext.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68cf7b6..5368734 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,7 +151,7 @@ dependencies = [ [[package]] name = "dalet" -version = "1.0.0-pre9" +version = "1.0.0-pre10" dependencies = [ "bincode", "clap", diff --git a/Cargo.toml b/Cargo.toml index 39e232b..8e5ba2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dalet" -version = "1.0.0-pre9" +version = "1.0.0-pre10" edition = "2021" authors = ["artegoser"] license = "MIT" diff --git a/src/parsers/gemtext.rs b/src/parsers/gemtext.rs index 811d63d..65fce98 100644 --- a/src/parsers/gemtext.rs +++ b/src/parsers/gemtext.rs @@ -27,7 +27,7 @@ pub fn parse_gemtext(s: &str) -> Result, GemTextParseError> { list.clear(); } else if line.starts_with("=>") { let body = line.split_off(2); - let mut body = body.trim().splitn(2, " "); + let mut body = body.trim().splitn(2, char::is_whitespace); let url = body.next().ok_or(GemTextParseError::InvalidLink)?.trim();