emoji: Add support for translating emoticons.

Add `translate_emoticons` to `prop_types` and `expected_keys`.
Furthermore, create a emoji-translating Markdown inline pattern.

Also use a JavaScript version of `translate_emoticons` and then use
this function during Markdown previews and as a preprocessor. This
is only needed for previews, because usually emoticon translation
happens on the backend after sending.

Add tests for emoticon translation, a settings UI, and a /help/ page
as well.

Tweaked by tabbott to fix various test failurse as well as how this
handles whitespace, requiring emoticons to not have adjacent
characters.

Fixes #1768.
This commit is contained in:
Marco Burstein
2018-01-15 10:36:32 -08:00
committed by Tim Abbott
parent 038579b840
commit bdb86f1b5e
19 changed files with 315 additions and 5 deletions

View File

@@ -885,6 +885,7 @@ exports.initialize = function () {
} else {
preview_html = rendered_content;
}
$("#preview_content").html(preview_html);
if (page_params.emojiset === "text") {
$("#preview_content").find(".emoji").replaceWith(function () {