Correct logic for link description

This commit is contained in:
Gabriel Simmer 2023-08-13 18:20:48 +01:00
parent 97d7462789
commit 660c94fc9a
Signed by: arch
SSH key fingerprint: SHA256:mXaHIY3tLtudNyb+i3qRd0DeXvpqbst04OgVKVCp2R4

View file

@ -126,7 +126,7 @@ impl HtmlHandler<Error> for DefaultHtmlHandler {
let link_extension = &link.path.split(".").last().unwrap();
// Orgmode considers something an image both if the pattern
// matches /and/ the description is empty.
if image_pattern.contains(link_extension) && link.desc.is_some() {
if image_pattern.contains(link_extension) && link.desc.is_none() {
write!(
w,
"<img src=\"{}\" alt=\"{}\">",