Skip to content

2.x: parseToAliases is missing but the README shipped at 2.2.0 still documents it #551

Description

@yoobi

Description of Bug

Affects 2.2.0 (upgrading from 1.9.7).

The README shipped at tag 2.2.0 documents EmojiParser#parseToAliases(String) and
EmojiParser#parseToAliases(String, FitzpatrickAction) (lines 231-251), but the function does not
exist in the code at that tag, and it is not on develop either.

EmojiParser.kt provides parseToUnicode, parseToHtmlDecimal, parseToHtmlHexadecimal,
parseFromUnicode, replaceAllEmojis, removeAllEmojis, removeEmojis, removeAllEmojisExcept
and extractEmojis — there is no emoji → short code transform under any name. So either the API was
dropped accidentally during the 2.x module refactor, or it was dropped deliberately and the
documentation was not updated.

Reproduction Steps

  1. Depend on emojify + contract + moshi at 2.2.0.
  2. Follow the README's "parse to aliases" section:
val emojiManager = EmojiManager.create(context, MoshiDeserializer())
val result = emojiManager.parseToAliases("An 😀awesome 😃string with a few 😉emojis!")
  1. It fails to compile: unresolved reference parseToAliases. parseToUnicode, documented a few
    lines above it in the same README, resolves fine.

Additional Context

This is the 1.9.7 usage that no longer has an equivalent — outgoing text is stored as short codes,
incoming text is rendered back to emoji:

val payload = emojiManager.parseToAliases(userInput)    // emoji -> :short_code:
val display = emojiManager.parseToUnicode(serverText)   // :short_code: -> emoji  (still fine in 2.2.0)

If the removal was intentional, what is the recommended way to produce :short_code: output in 2.x?
Is parseFromUnicode with a custom EmojiTransformer the intended path, or is a helper planned
(something like parseToShortCodes, mirroring the new getForShortCode)? I am happy to open a PR
restoring it on top of parseFromUnicode if that would be welcome.

I searched the closed issues and did not find this reported.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions