From 8e4c7f215f11a3735bcf6f8944e13c1aa86d8101 Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 6 May 2021 18:06:59 +0300 Subject: Add a note about a possible optimization once the MF2 parser is ready --- src/micropub/post.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/micropub/post.rs') diff --git a/src/micropub/post.rs b/src/micropub/post.rs index 4d208c2..9edde54 100644 --- a/src/micropub/post.rs +++ b/src/micropub/post.rs @@ -330,6 +330,9 @@ async fn post_process_new_post(req: Request>, po let source = &uid; stream::iter(posts_with_bodies.into_iter()) .filter_map(|(url, body): (surf::Url, String)| async move { + // TODO: Replace this function once the MF2 parser is ready + // A compliant parser's output format includes rels, + // we could just find a Webmention one in there let pattern = easy_scraper::Pattern::new(r#""#).expect("Pattern for webmentions couldn't be parsed"); let endpoint = &pattern.matches(&body)[0]["url"]; if let Ok(endpoint) = url.join(endpoint) { Some((url, endpoint)) } else { None } -- cgit 1.4.1