gjtorikian / html-pipeline

HTML processing filters and utilities
MIT License
2.27k stars 382 forks source link

EmojiFilter: img alt tag should contain screen-reader-friendly alt text #286

Closed parkr closed 6 years ago

parkr commented 6 years ago

Currently, alt text like ":+1:" is not accessible for screen readers. Gemoji v3.x introduced plain-English descriptions, which are a superior solution for screen readers. Instead of "colon plus sign one colon", the reader will instead hear "thumbs up emoji."

There are several GitHub-specific emoji which do not have descriptions. Those can be added to the database in the github/gemoji repository.

This was originally requested by @hectorsector in https://github.com/jekyll/jemoji/issues/67.

What do you think?

parkr commented 6 years ago

/cc @jch @gjtorikian @pathawks who might have feels about this PR.

gjtorikian commented 6 years ago

I'm a total plus one for the change, but I would rather we either:

Basically, I detest the >= version signifier and that may open us up to more headaches in the future if significant changes occur down the line.

parkr commented 6 years ago

@gjtorikian Ok! What about >= 2.0, < 3?

parkr commented 6 years ago

Whoops, I mean >= 2.0, < 4

gjtorikian commented 6 years ago

That'd work!

parkr commented 6 years ago

Basically, I detest the >= version signifier and that may open us up to more headaches in the future if significant changes occur down the line.

@gjtorikian And to be sure, these version constraints are not in the gemspec, so users of html-pipeline may use Gemoji 4 in the future regardless of this change. All I'm doing here is asking if there's a description attribute and using that instead of the :#{name}: if it's present.

parkr commented 6 years ago

I can't programmatically determine the version of Gemoji very easily, because it doesn't export its version:

>> Emoji.constants
=> [:TEXT_GLYPHS, :VARIATION_SELECTOR_16, :Character, :ZERO_WIDTH_JOINER, :FEMALE_SYMBOL, :MALE_SYMBOL]