From 4e320d9a4432a105aae57287f02eb81ae8a742c5 Mon Sep 17 00:00:00 2001 From: Artemy Egorov Date: Wed, 7 Aug 2024 12:10:04 +0300 Subject: [PATCH] fix: gemtext output --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/parsers/gemtext.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44b68d1..18bc624 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,7 +151,7 @@ dependencies = [ [[package]] name = "dalet" -version = "1.0.0-pre.11" +version = "1.0.0-pre.12" dependencies = [ "bincode", "clap", diff --git a/Cargo.toml b/Cargo.toml index 65fe402..c157272 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dalet" -version = "1.0.0-pre.11" +version = "1.0.0-pre.12" edition = "2021" authors = ["artegoser"] license = "MIT" diff --git a/src/parsers/gemtext.rs b/src/parsers/gemtext.rs index 65fce98..0c000e7 100644 --- a/src/parsers/gemtext.rs +++ b/src/parsers/gemtext.rs @@ -1,5 +1,5 @@ use crate::typed::{ - Body, Hl, TNArg, + Body, Hl, Page, TNArg, Tag::{self, *}, }; @@ -8,7 +8,7 @@ pub enum GemTextParseError { InvalidLink, } -pub fn parse_gemtext(s: &str) -> Result, GemTextParseError> { +pub fn parse_gemtext(s: &str) -> Result { let mut page: Vec = Vec::new(); let mut preformatted = false; let mut preformatted_text: Vec = Vec::new(); @@ -65,5 +65,5 @@ pub fn parse_gemtext(s: &str) -> Result, GemTextParseError> { } } - Ok(page) + Ok(Page { data: page }) }