Skip to content

Commit

Permalink
markdown: Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sgued authored and Keats committed Feb 16, 2023
1 parent 5311453 commit 76ca540
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions components/markdown/src/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,10 @@ pub fn markdown_to_html(
.context("Failed to render anchor link template")?;
if context.insert_anchor != InsertAnchor::Heading {
anchors_to_insert.push((anchor_idx, Event::Html(anchor_link.into())));
} else {
if let Some(captures) = A_HTML_TAG.captures(&anchor_link) {
let opening_tag = captures.get(1).map_or("", |m| m.as_str()).to_string();
anchors_to_insert.push((start_idx + 1, Event::Html(opening_tag.into())));
anchors_to_insert.push((end_idx, Event::Html("</a>".into())));
}
} else if let Some(captures) = A_HTML_TAG.captures(&anchor_link) {
let opening_tag = captures.get(1).map_or("", |m| m.as_str()).to_string();
anchors_to_insert.push((start_idx + 1, Event::Html(opening_tag.into())));
anchors_to_insert.push((end_idx, Event::Html("</a>".into())));
}
}

Expand Down

0 comments on commit 76ca540

Please sign in to comment.