diff --git a/components/rendering/src/markdown.rs b/components/rendering/src/markdown.rs index 926d0c9..6b79077 100644 --- a/components/rendering/src/markdown.rs +++ b/components/rendering/src/markdown.rs @@ -54,8 +54,6 @@ fn fix_link(link: &str, context: &RenderContext) -> Result { // - it could be a relative link (starting with `./`) // - it could be a link to a co-located asset // - it could be a normal link - // - any of those can be in a header or not: if it's in a header - // we need to append to a string let result = if link.starts_with("./") { match resolve_internal_link(&link, context.permalinks) { Ok(url) => url, @@ -82,18 +80,18 @@ fn fix_link(link: &str, context: &RenderContext) -> Result { Ok(result) } -fn start_tag(temp_header: &mut TempHeader, tag: &Tag) -> bool { +fn push_start_tag(temp_header: &mut TempHeader, tag: &Tag) -> bool { match tag { Tag::Emphasis => temp_header.add_html(""), Tag::Strong => temp_header.add_html(""), Tag::Code => temp_header.add_html(""), - // Tag::Link is handled elsewhere + // Tag::Link is handled in `markdown_to_html` _ => return false, } true } -fn end_tag(temp_header: &mut TempHeader, tag: &Tag) -> bool { +fn push_end_tag(temp_header: &mut TempHeader, tag: &Tag) -> bool { match tag { Tag::Emphasis => temp_header.add_html(""), Tag::Strong => temp_header.add_html(""), @@ -107,8 +105,8 @@ fn end_tag(temp_header: &mut TempHeader, tag: &Tag) -> bool { /// returns true if event have been processed fn push_to_temp_header(event: &Event, temp_header: &mut TempHeader) -> bool { match event { - Event::Start(tag) => start_tag(temp_header, tag), - Event::End(tag) => end_tag(temp_header, tag), + Event::Start(tag) => push_start_tag(temp_header, tag), + Event::End(tag) => push_end_tag(temp_header, tag), _ => false, } } @@ -140,7 +138,7 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result