".to_string()
+ }
+ CodeBlockKind::Fenced(CowStr::Borrowed("rawmermaid")) => {
+ "".to_string()
+ }
CodeBlockKind::Fenced(code_type) => format!("", code_type),
}
}
@@ -141,15 +183,11 @@ fn render_blockquote(quote_kind: Option) -> String {
None => {
"".to_string()
},
- Some(kind) => {
- match kind {
- BlockQuoteKind::Note => "Note
".to_string(),
- BlockQuoteKind::Tip => "
Tip
".to_string(),
- BlockQuoteKind::Important =>"
Important
".to_string(),
- BlockQuoteKind::Warning => "
Warning
".to_string(),
- BlockQuoteKind::Caution => "
Caution
".to_string(),
- }
- },
+ Some(BlockQuoteKind::Note) => "
Note
".to_string(),
+ Some(BlockQuoteKind::Tip) => "
Tip
".to_string(),
+ Some(BlockQuoteKind::Important) =>"
Important
".to_string(),
+ Some(BlockQuoteKind::Warning) => "
Warning
".to_string(),
+ Some(BlockQuoteKind::Caution) => "
Caution
".to_string(),
}
}
fn render_link(link_type: LinkType, dest_url: CowStr<'_>, title: CowStr<'_>) -> String {
@@ -163,9 +201,28 @@ fn render_link(link_type: LinkType, dest_url: CowStr<'_>, title: CowStr<'_>) ->
LinkType::ShortcutUnknown => format!("
", dest_url, title),
LinkType::Autolink => format!("", dest_url, title),
LinkType::Email => format!("", dest_url, title),
- LinkType::WikiLink{has_pothole: _} => { // TODO
+ LinkType::WikiLink { has_pothole: _ } => {
+ // TODO: refactor
format!("", dest_url, title)
- },
+ }
+ }
+}
+
+fn render_image(link_type: LinkType, dest_url: CowStr<'_>, title: CowStr<'_>) -> String {
+ match link_type {
+ LinkType::Inline => format!("
", dest_url, title),
+ LinkType::Reference => format!("
", dest_url, title),
+ LinkType::ReferenceUnknown => format!("
", dest_url, title),
+ LinkType::Collapsed => format!("
", dest_url, title),
+ LinkType::CollapsedUnknown => format!("
", dest_url, title),
+ LinkType::Shortcut => format!("
", dest_url, title),
+ LinkType::ShortcutUnknown => format!("
", dest_url, title),
+ LinkType::Autolink => format!("
", dest_url, title),
+ LinkType::Email => format!("
", dest_url, title),
+ LinkType::WikiLink { has_pothole: _ } => {
+ // TODO: refactor
+ format!("
", dest_url, title)
+ }
}
}