diff --git a/lib/org-ruby/html_output_buffer.rb b/lib/org-ruby/html_output_buffer.rb
index 180bd80..fc14bc4 100644
--- a/lib/org-ruby/html_output_buffer.rb
+++ b/lib/org-ruby/html_output_buffer.rb
@@ -314,19 +314,14 @@ def inline_formatting(str)
text.sub!(/\Afile(|\+emacs|\+sys):(?=[^\s]+\Z)/, "")
end
- # We don't add a description for images in links, because its
- # empty value forces the image to be inlined.
- defi ||= link unless link =~ @re_help.org_image_file_regexp
-
- if defi =~ @re_help.org_image_file_regexp
- defi = quote_tags ""
- end
-
- if defi
- link = @options[:link_abbrevs][link] if @options[:link_abbrevs].has_key? link
- quote_tags("") + defi + quote_tags("")
+ if link =~ @re_help.org_image_file_regexp
+ quote_tags "
"
else
- quote_tags "
"
+ if defi =~ @re_help.org_image_file_regexp
+ defi = quote_tags "
"
+ end
+ link = @options[:link_abbrevs][link] if @options[:link_abbrevs].has_key? link
+ quote_tags("") + (defi || link) + quote_tags("")
end
end
diff --git a/spec/html_examples/image-with-alt-description.html b/spec/html_examples/image-with-alt-description.html
new file mode 100644
index 0000000..57baf72
--- /dev/null
+++ b/spec/html_examples/image-with-alt-description.html
@@ -0,0 +1,3 @@
+
Image with alt description
+This image should use the description as the alt attribute:
+