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

Compare method does not seem to be working #18

Open
sciofu opened this issue Apr 11, 2023 · 2 comments
Open

Compare method does not seem to be working #18

sciofu opened this issue Apr 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@sciofu
Copy link

sciofu commented Apr 11, 2023

Hello,
I've been trying to make the diff-viewer highlight trailing spaces and newlines, but it does not seem to be able to do that.

I tried using different compareMethod values, DiffMethod.WORDS_WITH_SPACE seemed to be the right one. However, it did not do the job.

I also tried separately to use the the method from the diff package, and that managed to return the trailing characters.

Is it something that I am missing? Should I also use it alongside other relevant props?

Cheers!

@Aeolun
Copy link
Owner

Aeolun commented Jun 19, 2023

It might be eating the diffed spaces due to it being HTML. Let me check.

@Aeolun Aeolun added the bug Something isn't working label Jun 19, 2023
@kevinlu1248
Copy link

I think the custom diff render is also not working. As a way to repro, you can try setting it to (originalCode: string, newCode: string): jsdiff.Change[] => { return []; } and the diff won't disappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants