mirror of
https://github.com/TxtDot/dalet-rs.git
synced 2024-11-24 01:26:22 +03:00
fix: gemtext list parsing
This commit is contained in:
parent
8fb4f31ece
commit
2fd17796c0
3 changed files with 5 additions and 5 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -151,7 +151,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dalet"
|
name = "dalet"
|
||||||
version = "1.0.0-pre8"
|
version = "1.0.0-pre9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"clap",
|
"clap",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "dalet"
|
name = "dalet"
|
||||||
version = "1.0.0-pre8"
|
version = "1.0.0-pre9"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["artegoser"]
|
authors = ["artegoser"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -19,12 +19,12 @@ pub fn parse_gemtext(s: &str) -> Result<Vec<Tag>, GemTextParseError> {
|
||||||
for line in s.lines() {
|
for line in s.lines() {
|
||||||
let mut line = line.trim().to_owned();
|
let mut line = line.trim().to_owned();
|
||||||
|
|
||||||
if list_before && !line.starts_with("* ") {
|
if preformatted && !line.starts_with("```") {
|
||||||
|
preformatted_text.push(line);
|
||||||
|
} else if list_before && !line.starts_with("* ") {
|
||||||
page.push(Tag::Ul(list.clone()));
|
page.push(Tag::Ul(list.clone()));
|
||||||
list_before = false;
|
list_before = false;
|
||||||
list.clear();
|
list.clear();
|
||||||
} else if preformatted && !line.starts_with("```") {
|
|
||||||
preformatted_text.push(line);
|
|
||||||
} else if line.starts_with("=>") {
|
} else if line.starts_with("=>") {
|
||||||
let body = line.split_off(2);
|
let body = line.split_off(2);
|
||||||
let mut body = body.trim().splitn(2, " ");
|
let mut body = body.trim().splitn(2, " ");
|
||||||
|
|
Loading…
Add table
Reference in a new issue