HumanSignal / HumanSignal/label-studio

Highlighting emojis in Text tags is showing strange Glyphs �

Open
#6,057 2 comments 0 reactions 0 assignees View on GitHub
community:bug community:reviewed
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Describe the bug**

If you have emojis in Text data, highlighting them generates glyphs �
![image](https://github.com/HumanSignal/label-studio/assets/133171671/827bd3e8-3420-45ac-96ed-c76e09ba960e)

I found that if I turn off FF_LSDV_4620_3, the issue goes away:
![image](https://github.com/HumanSignal/label-studio/assets/133171671/fad7b4b9-b255-4b15-9e23-6cf1c7da440d)

The issue seems to be
```
self._spans = self.parent.createSpansByGlobalOffsets(self.globalOffsets);
```
https://github.com/HumanSignal/label-studio/blob/develop/web/libs/editor/src/mixins/HighlightMixin.js#L70

The spans that are generated have strange \u characters.

**To Reproduce**
Steps to reproduce the behavior:
1. Import a task with emojis
2. Make your project have a `` tag with ``.
3. Select any label, then highlight the emoji
4. see the glyph

**Expected behavior**
The emojis are properly highlighted

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. iOS]
- Label Studio Version [e.g. 0.8.0]

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.