Create accessible function
This commit is contained in:
parent
ac858bdf0a
commit
9cd4e8571e
3 changed files with 8 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -3167,7 +3167,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rss_content"
|
name = "rss_content"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ego-tree",
|
"ego-tree",
|
||||||
"iced",
|
"iced",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "rss_content"
|
name = "rss_content"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -15,6 +15,11 @@ pub enum Content {
|
||||||
Ignore
|
Ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn parse_content(c: &str) -> Vec<Content>{
|
||||||
|
|
||||||
|
process_content(itemize_content(c))
|
||||||
|
}
|
||||||
|
|
||||||
fn markdownify_child(item: &Item) -> String {
|
fn markdownify_child(item: &Item) -> String {
|
||||||
let mut result = "".to_owned();
|
let mut result = "".to_owned();
|
||||||
match markdown_content(&item) {
|
match markdown_content(&item) {
|
||||||
|
@ -141,7 +146,7 @@ enum Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn itemize_content(content: &str) -> Vec<Item> {
|
fn itemize_content(content: &str) -> Vec<Item> {
|
||||||
let frag = Html::parse_fragment(content);
|
let frag = Html::parse_fragment(content);
|
||||||
frag.root_element().children().map(|e|{
|
frag.root_element().children().map(|e|{
|
||||||
parse_items(e)
|
parse_items(e)
|
||||||
|
|
Loading…
Reference in a new issue