Skip to content

Release 1.2 - with even more unicode!

Compare
Choose a tag to compare
@gaqzi gaqzi released this 08 Apr 17:42
· 59 commits to master since this release

Highlights

  • Added a setting for changing the output of the <img> tag
  • Added a method to replace html encoded unicode characters with their unicode counterparts
  • Changed the default for replace_unicode so the alt attribute is the unicode character that was made into an image. This to allow for proper behavior when copy-pasting.

Thanks to @pistos2 for the work on replace_html_entities and setting the unicode character as the alt value.

Changelog

  • Emoji.replace_html_entities replaces all unicode html entities
    with their corresponding unicode character. This method is now by
    default called before Emoji.replace_unicode. (@pistos2)
  • Emoji.replace_unicode will now set the <img alt> attribute to be
    the unicode character being replaced. This change done to allow
    marking and copying strings with emojis and the unicode character
    being copied along correctly. (@pistos2)
  • Change the <img> tag to also have a title attribute that is the
    text representation of the current character being encoded.
  • Added settings for new options:
    • EMOJI_ALT_AS_UNICODE, default: True
    • EMOJI_REPLACE_HTML_ENTITIES, default: True
    • EMOJI_IMG_TAG, default:
      <img src="{0}" alt="{1}" title="{2}" class="emoji">
  • Added support for running on a narrow unicode build of Python.
    The test suite passed on narrow builds but it has not been production
    tested with a narrow build.