EN
HTML - prevent rendering unicode characters as emoji
9 points
In this article, we would like to show how to prevent emoji rendering when we use Unicode characters in HTML.
Quick solution:
Wrap Unicode character with element adding
︎
code after the character.Warning: In may not working on some web browsers (e.g. Google Chrome on mobile).
Note: to know more about
U+FE0E
code that is called VARIATION SELECTOR-15, can be found here.
xxxxxxxxxx
1
<p>π︎</p>
Output:
xxxxxxxxxx
1
ποΈ
Hint: if you do not see the result in the above output, it means your browser doesn't support the feature.
Practical example
xxxxxxxxxx
1
2
<html>
3
<body>
4
<div>
5
<span>π</span>
6
<span>π︎</span>
7
</div>
8
<div>
9
<span>π</span>
10
<span>π︎</span>
11
</div>
12
<div>
13
<span>π</span>
14
<span>π︎</span>
15
</div>
16
<div>
17
<span>π</span>
18
<span>π︎</span>
19
</div>
20
<div>
21
<span>π</span>
22
<span>π︎</span>
23
</div>
24
<div>
25
<span>β</span>
26
<span>β︎</span>
27
</div>
28
<div>
29
<span>π</span>
30
<span>π︎</span>
31
</div>
32
<div>
33
<span>π</span>
34
<span>π︎</span>
35
</div>
36
</body>
37
</html>