-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Zero width chars not showing in diff #10584
Comments
hey can I work on this issue |
@devil-cyber sure, thanks! |
Can you please explain a bit how to get satrted
…On Tue, Oct 6, 2020, 4:27 PM Simen Bekkhus ***@***.***> wrote:
@devil-cyber <https://github.com/devil-cyber> sure, thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10584 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMPIV6SRF6YBAJ7PXUA6NDLSJLZZ7ANCNFSM4SD3APZA>
.
|
This is really @pedrottimark's domain, but it should be somewhere in https://github.com/facebook/jest/tree/5da90b58eb6673e6f406f9ebc369b1f0fb747384/packages/jest-diff. Maybe @jeysal could provide some more details? |
Ok
…On Tue, Oct 6, 2020, 5:00 PM Simen Bekkhus ***@***.***> wrote:
This is really @pedrottimark <https://github.com/pedrottimark>'s domain,
but it should be somewhere in
https://github.com/facebook/jest/tree/5da90b58eb6673e6f406f9ebc369b1f0fb747384/packages/jest-diff.
Maybe @jeysal <https://github.com/jeysal> could provide some more details?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10584 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMPIV6RNGEGSFLYBHMN4X6LSJL5T5ANCNFSM4SD3APZA>
.
|
I would expect most of the changes to be in |
Ok
…On Tue, Oct 6, 2020, 5:06 PM Tim Seckinger ***@***.***> wrote:
I would expect most of the changes to be in pretty-format more likely
than jest-diff.
We want to serialize a string starting with certain characters in a
different way.
There should probably be a brief discussion on how exactly this should be
visualized, ideally with input from @aryzing <https://github.com/aryzing>
as well.
Maybe "\uFEFFbla", but then how do we distinguish it from a string
actually containing those characters (afaik backslashes are not an escape
character in formatted strings)? Maybe move it before the "?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10584 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMPIV6URBXMS6UGEMQXIOIDSJL6MXANCNFSM4SD3APZA>
.
|
@jeysal on my side no strong preferences on display, just thought I'd bring this up as it might trip up others in the future. Perhaps there's appetite for visually separating parts of the string corresponding to invisible characters or whitespace characters other than the typical whitespace you get with the spacebar. Maybe (fyi, 00A0 is no-break space)
Like I said, no strong feelings either way, I'm sure that any reasonable indication of the presence of such characters will be fine. |
Work around until jestjs/jest#10584 is solved
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
Believe this isn't resolved yet, is it? |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
I was just thinking about a solution for the issue. Sorry I couldn't declare it before working on it. I will try to create a PR as well. I thought #13997 was a very good approach. I thought the issue was that simply replacing a zero-width space with a no-break space makes it difficult to recognize that it is a zero-width space. I took the approach of using Note to tell that a zero-width space exists. The disadvantages of this approach are that it is difficult to visually see where the zero-width space exists and that it is impossible to detect when there are multiple zero-width spaces. I hope my PR will be of help and reference for a good solution. |
🐛 Bug Report
Differences in strings containing zero width chars are not highlighted, making them incredibly hard to spot and debug. Eg, one of the following strings has as its first character (character at position 0) a byte order mark character as its first character, and the other has the letter "T" as its first character.
Additional useful info
FEFF
, or 65279 in decimal.To Reproduce
Just create two strings that look identical, one of which contains a character such as the BOM character.
Expected behavior
A clear indication of the difference.
envinfo
The text was updated successfully, but these errors were encountered: