cleanup
This commit is contained in:
parent
b90e557a3d
commit
2eb9b5d3c7
1 changed files with 4 additions and 4 deletions
|
|
@ -51,7 +51,6 @@ fn process_children(children: &Vec<Item>) -> String {
|
||||||
|
|
||||||
|
|
||||||
fn has_image(children: &Vec<Item>) -> bool {
|
fn has_image(children: &Vec<Item>) -> bool {
|
||||||
let mut result = false;
|
|
||||||
for c in children {
|
for c in children {
|
||||||
match c {
|
match c {
|
||||||
Item::Image(_) => {
|
Item::Image(_) => {
|
||||||
|
|
@ -60,11 +59,10 @@ fn has_image(children: &Vec<Item>) -> bool {
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_video(children: &Vec<Item>) -> bool{
|
fn has_video(children: &Vec<Item>) -> bool{
|
||||||
let mut result = false;
|
|
||||||
for c in children {
|
for c in children {
|
||||||
match c {
|
match c {
|
||||||
Item::Video(_) => {
|
Item::Video(_) => {
|
||||||
|
|
@ -227,7 +225,6 @@ enum Item {
|
||||||
//text, links, formatting are all markdown
|
//text, links, formatting are all markdown
|
||||||
//arguably, for better control it will be best to turn markdown into its own set of items
|
//arguably, for better control it will be best to turn markdown into its own set of items
|
||||||
Image(String),
|
Image(String),
|
||||||
Svg(String),// wont' support for a while I think.
|
|
||||||
Video(Vec<Item>),
|
Video(Vec<Item>),
|
||||||
Audio(Vec<Item>),
|
Audio(Vec<Item>),
|
||||||
Source(String),
|
Source(String),
|
||||||
|
|
@ -303,6 +300,9 @@ fn parse_items(n: ego_tree::NodeRef<'_,Node>) -> Item{
|
||||||
"video" => {
|
"video" => {
|
||||||
return Item::Video(get_children(&el))
|
return Item::Video(get_children(&el))
|
||||||
}
|
}
|
||||||
|
"audio" => {
|
||||||
|
return Item::Audio(get_children(&el))
|
||||||
|
}
|
||||||
"ol" => {
|
"ol" => {
|
||||||
return Item::OrderedList(get_children(&el))
|
return Item::OrderedList(get_children(&el))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue