Skip to content

diffChars wildcard/mapping #127

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

Closed
thomasdebruin opened this issue Aug 12, 2016 · 2 comments
Closed

diffChars wildcard/mapping #127

thomasdebruin opened this issue Aug 12, 2016 · 2 comments
Labels

Comments

@thomasdebruin
Copy link

Is there any option to use a wildcard or mapping for certain characeters when using diffChars? Lets say I compare 2 pieces but it shouldn't matter whetere someone types: {.||,},{ij||y} etc.
Probably beyond the scope of this plugin.

@thomasdebruin
Copy link
Author

Okay, I solved this by replacing the ij (similar on some writing and pronouncement in Dutch language) with a placeholder character (special char like #) then made my own extend of the base js, in that extend the 'equals' function then treats the # like an ij and returns true if it's equal to y.

Maybe it's not the most sophistacated solution but it works.

@ExplodingCabbage
Copy link
Collaborator

Yeah, some mixture of replacing characters or character sequences with placeholders (which could be Symbol objects if you're willing to use diffArrays instead of diffChars) and/or overriding .equals seems like the right solution here!

I've made a ticket for creating some docs about that: #432

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

No branches or pull requests

2 participants