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

U+FEFF as a ZWNBSP character is deprecated #2597

Open
thallada opened this issue Feb 13, 2019 · 8 comments
Open

U+FEFF as a ZWNBSP character is deprecated #2597

thallada opened this issue Feb 13, 2019 · 8 comments

Comments

@thallada
Copy link
Contributor

See: https://www.w3.org/TR/unicode-xml/#BOM

I'm pretty sure that Slate is using the U+FEFF character in a way that is now deprecated in Unicode 3.2. I see that Slate switched from U+200B to using this character to fix this issue: #2231. It's recommended to use U+2060 instead as a zero-width non-breaking space character. I think that issue would not be a problem if Slate used U+2060 instead.

I discovered this issue when sanitizing the HTML in my backend. U+FEFF is stripped from the content, but U+2060 is kept.

@brendancarney
Copy link
Collaborator

I don't know much about this but I'm sure we'd welcome a PR if this is the right character to be using.

@SmilinBrian
Copy link
Contributor

I don't know how quickly we should jump on this. If you scroll to the top of the referenced Technical Report, the Status part says:

This document has been withdrawn
Many of the materials in this document are stale and out of date; the W3C is maintaining this version solely as a historical reference. This document was originally produced as a joint publication between the W3C and the Unicode Consortium. In 2016, Unicode withdrew publication as a Unicode Technical Report.

I was unable to locate a current, published version of this particular report. On the other hand, maybe this deprecation is repeated in some more general Unicode Report?

@glebtv
Copy link

glebtv commented Apr 30, 2019

I think the idea in #1971 about implementing this via <br/> is more solid. Any invisible characters are bad in an editor, since users might copy text from it, and it might be links, source code, etc - and invisible characters often cause cryptic errors

@milapshah15
Copy link

milapshah15 commented Sep 27, 2022

Facing the same issue, What is the solution?

#5141

@thallada
Copy link
Contributor Author

thallada commented Sep 27, 2022

You should see if you can convert U+FEFF characters into <br>s before you run any HTML sanitization that would strip them. I think that's how I might have gotten around this issue, but it's been a while and I don't remember exactly.

@milapshah15
Copy link

This has recently started after upgrading to Chrome 105

@standreinmcp
Copy link

I also have the issue when I updated to Chrome 105. Any ideas how to fix it ? @milapshah15

@coderkind
Copy link

coderkind commented Jan 8, 2025

The U+FEFF character introduces a bug with Chrome and the JAWS screen reader also; announcing empty contenteditable fields as being non-empty.

@ianstormtaylor why is the character added in the first place? Can it be removed? Looking at the links at the top of this bug report, it seems it's a deliberate thing to add spacing at the start of inline blocks?

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

8 participants