Skip to content

Commit

Permalink
Empty alt attributes on <img> are now correctly handled by the kramdo…
Browse files Browse the repository at this point in the history
…wn converter, fixes #198
  • Loading branch information
gettalong committed Feb 4, 2015
1 parent 0a70cda commit c91b4dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kramdown/converter/kramdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def convert_a(el, opts)
end

def convert_img(el, opts)
alt_text = el.attr['alt'].gsub(ESCAPED_CHAR_RE) { $1 ? "\\#{$1}" : $2 }
alt_text = el.attr['alt'].to_s.gsub(ESCAPED_CHAR_RE) { $1 ? "\\#{$1}" : $2 }
if el.attr['src'].empty?
"![#{alt_text}]()"
else
Expand Down

0 comments on commit c91b4dd

Please sign in to comment.