Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alt Attribute for Emoji Images Should Use Unicode #272

Closed
Crissov opened this issue Mar 23, 2017 · 1 comment
Closed

alt Attribute for Emoji Images Should Use Unicode #272

Crissov opened this issue Mar 23, 2017 · 1 comment
Labels

Comments

@Crissov
Copy link

Crissov commented Mar 23, 2017

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 gjtorikian added the v3 label Feb 16, 2021
@gjtorikian
Copy link
Owner

Thanks for the report. I believe as of #373 this is moot for v3.0+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants