# Automatically add a space before the emoji if the user is typing Chinese and uses emoji picker

**URL:** <https://meta.discourse.org/t/automatically-add-a-space-before-the-emoji-if-the-user-is-typing-chinese-and-uses-emoji-picker/83285>\
**Category:** Feature\
**Created:** [2018年三月19日 08:24 UTC](https://meta.discourse.org/t/automatically-add-a-space-before-the-emoji-if-the-user-is-typing-chinese-and-uses-emoji-picker/83285 "2018-03-19T08:24:02Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2018年七月11日 01:19 UTC](https://meta.discourse.org/t/automatically-add-a-space-before-the-emoji-if-the-user-is-typing-chinese-and-uses-emoji-picker/83285/9 "2018-07-11T01:19:34Z")

</div>

We have a few options here:

1. Allow `呵:t_rex:` so `:t_rex:` is an emoji. The problem though is that it is very expensive to detect Chinese per [https://github.com/alsotang/is-chinese/blob/master/ischinese.js](https://github.com/alsotang/is-chinese/blob/master/ischinese.js) so this would add a bunch of extra slowness to the MD engine.

2. Fix it so autocomplete behaves consistently with the way the engine interprets it. Meaning `呵:t` **should not** pop open an emoji window.

3. @schungx suggestion where after autocomplete is done we insert a space prior to emoji if needed.

4. Add a “special mode” into Markdown where it requires no special punctuation between emoji and then `a:t_rex:a` would render a 🦖 a.

I feel like the best way forward here is (2) and (4) combined. So:

- Out-of-the-box autocomplete is not doing any funny business where it pretends to add an emoji and does not

- In Chinese forums where words are just joined we would set `SiteSetting.require_punct_before_emoji = false` (and have autocomplete respect this)

@misaka4e21 / @tgxworld what are your thoughts here?

---

_[View the full topic](https://meta.discourse.org/t/automatically-add-a-space-before-the-emoji-if-the-user-is-typing-chinese-and-uses-emoji-picker/83285)._
