diff --git a/src/lib.rs b/src/lib.rs index b833869..67da32d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,6 +22,7 @@ pub fn parse_content(c: &str) -> Vec{ match i { Content::Markdown(s) => { Content::MarkdownParsed(markdown::parse(&s).collect()) + //this is super lazy but it works.... } _ => {i} } @@ -110,7 +111,42 @@ fn markdown_content(item: &Item) -> Content { Content::Markdown(markdown) } -fn media_content(_: &Item) -> Content{ +fn get_media_source(children: &Vec) -> Option { + for c in children { + match c { + Item::Source(src) => { + return Some(src.to_owned()); + } + _ => {} + } + } + None +} + +fn media_content(item: &Item) -> Content{ + match item { + Item::Audio(children) => { + match get_media_source(children) { + Some(s) => { + return Content::Audio(s); + } + None => { + return Content::Markdown("