unexpected
unexpected copied to clipboard
Clean up stringDiff
When working on #270 we found out that the string diffing code is a terrible mess. We should figure out:
- Whether parts of it should be moved to a utility function so that the magicpen style only has to do with things that can strictly be considered styling
- If we can avoid
prependLinesWith
and the various hacks that necessitates withalt
.
We can also think about making the diffing code a standalone magicpen plugin, and maybe even rework the diff library to support diffing the text in magicpen instances (so that we can do github-style diffs with syntax highlighting).
What is your use case for github like diffs. Are you diffing a lot of source code?
Doing better now as of #276.
Whoops, accidentally replied to this on the wrong issue, copy/pasting here:
What is your use case for github like diffs. Are you diffing a lot of source code?
It'd be a nice-to-have for diffing messy.Http(Request|Response) bodies for which we have a syntax highlighter available, as determined by the Content-Type. Also, https://github.com/unexpectedjs/unexpected-function-equality would also benefit from being able to have the diffed code syntax highlighted.
... But I admit that I mostly bring it up because it'd be insanely cool to get it to work :)
@papandreou did we manage to tackle this when we added the string diff collapsing stuff?
No, I'm fairly sure it's still a mess.