alt Attribute for Emoji Images Should Use Unicode
Crissov opened this issue · 1 comments
Crissov commented
Copying emojis from Github and pasting them into Unicode-aware applications that do not support (proprietary) short codes with colons is currently broken.
In emoji_filter.rb:
# Default attributes for img tag
def default_img_attrs(name)
{
"class" => "emoji".freeze,
"title" => ":#{name}:",
"alt" => ":#{name}:",
"src" => "#{emoji_url(name)}",
"height" => "20".freeze,
"width" => "20".freeze,
"align" => "absmiddle".freeze,
}
end
The alternative textual representation of an image of a Unicode emoji is of course the emoji itself! Therefore, line 90 should read something like this: "alt" => "#{code}",
or "alt" => "#{emoji_code(name)}",
, probably using unicode_aliases.first
from gemoji.
Custom "emojis" should probably use ``#{name}` without colons.
My ruby-fu is sadly not up for the task, so I'm not providing a PR.
gjtorikian commented
Thanks for the report. I believe as of #373 this is moot for v3.0+.