Fix attachment formatting
This commit is contained in:
parent
17e99518ce
commit
4dae4360cc
1 changed files with 17 additions and 14 deletions
|
@ -57,19 +57,22 @@ fn format_attachments(depth: usize, attachments: &[Attachment]) -> String {
|
||||||
if attachments.is_empty() {
|
if attachments.is_empty() {
|
||||||
String::default()
|
String::default()
|
||||||
} else {
|
} else {
|
||||||
attachments
|
format!(
|
||||||
.iter()
|
"\n{}",
|
||||||
.map(|a| {
|
attachments
|
||||||
Url::parse(&a.url).unwrap().open();
|
.iter()
|
||||||
let mut editor = DefaultEditor::new().unwrap();
|
.map(|a| {
|
||||||
let src = if let Ok(line) = editor.readline("Filename: ") {
|
Url::parse(&a.url).unwrap().open();
|
||||||
line
|
let mut editor = DefaultEditor::new().unwrap();
|
||||||
} else {
|
let src = if let Ok(line) = editor.readline("Filename: ") {
|
||||||
a.url.clone()
|
line
|
||||||
};
|
} else {
|
||||||
format!("{} <img src=\"{}\" />", prefix, src)
|
a.url.clone()
|
||||||
})
|
};
|
||||||
.collect::<Vec<String>>()
|
format!("{} <img src=\"{}\" />", prefix, src)
|
||||||
.join("\n")
|
})
|
||||||
|
.collect::<Vec<String>>()
|
||||||
|
.join("\n")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue