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 "\"#{defi}\"" - 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 "\"#{defi" else - quote_tags "\"#{link}\"" + if defi =~ @re_help.org_image_file_regexp + defi = quote_tags "\"#{defi}\"" + 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:

+

A screenshot of our new UI

diff --git a/spec/html_examples/image-with-alt-description.org b/spec/html_examples/image-with-alt-description.org new file mode 100644 index 0000000..d453ab5 --- /dev/null +++ b/spec/html_examples/image-with-alt-description.org @@ -0,0 +1,5 @@ +Image with alt description + +This image should use the description as the alt attribute: + +[[file:screenshots/cool_screenshot.jpg][A screenshot of our new UI]]