Make markdown::parse take a Palette value
This commit is contained in:
parent
2796a6bc97
commit
2d69464846
2 changed files with 6 additions and 6 deletions
|
|
@ -28,7 +28,7 @@ impl Markdown {
|
|||
(
|
||||
Self {
|
||||
content: text_editor::Content::with_text(INITIAL_CONTENT),
|
||||
items: markdown::parse(INITIAL_CONTENT, &theme.palette())
|
||||
items: markdown::parse(INITIAL_CONTENT, theme.palette())
|
||||
.collect(),
|
||||
theme,
|
||||
},
|
||||
|
|
@ -46,7 +46,7 @@ impl Markdown {
|
|||
if is_edit {
|
||||
self.items = markdown::parse(
|
||||
&self.content.text(),
|
||||
&self.theme.palette(),
|
||||
self.theme.palette(),
|
||||
)
|
||||
.collect();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ pub enum Item {
|
|||
}
|
||||
|
||||
/// Parse the given Markdown content.
|
||||
pub fn parse<'a>(
|
||||
markdown: &'a str,
|
||||
palette: &'a theme::Palette,
|
||||
) -> impl Iterator<Item = Item> + 'a {
|
||||
pub fn parse(
|
||||
markdown: &str,
|
||||
palette: theme::Palette,
|
||||
) -> impl Iterator<Item = Item> + '_ {
|
||||
struct List {
|
||||
start: Option<u64>,
|
||||
items: Vec<Vec<Item>>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue