Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Plain Text Field strips out em dash character on save. #12905

Closed
myleshyson opened this issue Mar 15, 2023 · 2 comments
Closed

[4.x]: Plain Text Field strips out em dash character on save. #12905

myleshyson opened this issue Mar 15, 2023 · 2 comments
Assignees

Comments

@myleshyson
Copy link
Contributor

What happened?

Description

Noticed today that the plain text field strips out the em dash character on save because when it serializes the value it passes the value through LitEmoji::unicodeToShortcode. This is a problem because we're using a text field with a drop down to construct a title for a particular entry type, and the text field should allow em dashes (and probably other utf-8 charachters) like the native title field. Em dashes are persisted when used in the native title field.

Steps to reproduce

  1. Create a plain text field.
  2. Put some text in it with an em dash character.
  3. Save the entry and see that the em dash character is removed.

Expected behavior

Em dashes (and probably other unicode characters) should not be filtered out when saving a plain text field.

Actual behavior

Em dashes are filtered out when saving a plain text field.

Craft CMS version

4.4.1

PHP version

8.1.7

Operating system and version

No response

Database type and version

Mysql 8.0.31

Image driver and version

No response

Installed plugins and versions

@i-just
Copy link
Contributor

i-just commented Mar 16, 2023

Thanks for reporting. Various other punctuation characters are also affected by this. There’s also an open issue for this in elvanto/litemoji GitHub (link). We’ll discuss options internally, and once I have more info, I’ll update this issue again.

@brandonkelly
Copy link
Member

Just released 4.4.3 with a workaround for this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants