fix: gemtext output

This commit is contained in:
Artemy Egorov 2024-08-07 12:10:04 +03:00
parent 8f1cb86932
commit 4e320d9a44
3 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View file

@ -151,7 +151,7 @@ dependencies = [
[[package]] [[package]]
name = "dalet" name = "dalet"
version = "1.0.0-pre.11" version = "1.0.0-pre.12"
dependencies = [ dependencies = [
"bincode", "bincode",
"clap", "clap",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "dalet" name = "dalet"
version = "1.0.0-pre.11" version = "1.0.0-pre.12"
edition = "2021" edition = "2021"
authors = ["artegoser"] authors = ["artegoser"]
license = "MIT" license = "MIT"

View file

@ -1,5 +1,5 @@
use crate::typed::{ use crate::typed::{
Body, Hl, TNArg, Body, Hl, Page, TNArg,
Tag::{self, *}, Tag::{self, *},
}; };
@ -8,7 +8,7 @@ pub enum GemTextParseError {
InvalidLink, InvalidLink,
} }
pub fn parse_gemtext(s: &str) -> Result<Vec<Tag>, GemTextParseError> { pub fn parse_gemtext(s: &str) -> Result<Page, GemTextParseError> {
let mut page: Vec<Tag> = Vec::new(); let mut page: Vec<Tag> = Vec::new();
let mut preformatted = false; let mut preformatted = false;
let mut preformatted_text: Vec<String> = Vec::new(); let mut preformatted_text: Vec<String> = Vec::new();
@ -65,5 +65,5 @@ pub fn parse_gemtext(s: &str) -> Result<Vec<Tag>, GemTextParseError> {
} }
} }
Ok(page) Ok(Page { data: page })
} }