You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When replacing emojis with images in a whole HTML document, there may be areas/elements that need to be excluded from processing. For example: inline editors or elements with contentEditable. Ideally in such elements emoji characters would not be replaced. The replacement should happen when the edited content is displayed.
A nice way to control which HTML elements should be excluded from processing would probably be to have a callback function (that would return true/false) in the while loop in grabAllTextNodes().
I've considered using VS15 (U+FE0E) to force text presentation, however that is not suitable for use in inline editors/contentEditable. The requirement there is for emoji characters to be kept unchanged as the users have entered them.
The text was updated successfully, but these errors were encountered:
There is a (pretty crude) example of how that can be implemented: WordPress/wordpress-develop#3800. Note that the patch there is a "hotfix" to implement the above feature in the built twemoji.js. Can make a proper PR if needed.
When replacing emojis with images in a whole HTML document, there may be areas/elements that need to be excluded from processing. For example: inline editors or elements with
contentEditable
. Ideally in such elements emoji characters would not be replaced. The replacement should happen when the edited content is displayed.A nice way to control which HTML elements should be excluded from processing would probably be to have a callback function (that would return
true/false
) in thewhile
loop ingrabAllTextNodes()
.I've considered using VS15 (U+FE0E) to force text presentation, however that is not suitable for use in inline editors/contentEditable. The requirement there is for emoji characters to be kept unchanged as the users have entered them.
The text was updated successfully, but these errors were encountered: