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

Mapping of umlauts broken #50

Open
qqilihq opened this issue Sep 6, 2023 · 2 comments
Open

Mapping of umlauts broken #50

qqilihq opened this issue Sep 6, 2023 · 2 comments
Labels

Comments

@qqilihq
Copy link

qqilihq commented Sep 6, 2023

Hi all,

previous versions of Limax mapped German umlauts to the proper counterpart (e.g. ü will become ue). With the change in #44 and 4.0 unfortunately this breaks, and ü will now be mapped to a simple u which would be considered “less correct” in German.

Also, trying to fix it via a custom mapping will not help, as the _.deburr replacement happens without considering the given mappings. Our current workaround replaces them before applying limax:

  const fixedMapping = {
    ä: 'ae',
    Ä: 'Ae',
    ö: 'oe',
    Ö: 'Oe',
    ü: 'ue',
    Ü: 'Ue'
  };
  let fixedInput = input;
  for (const mapping of Object.entries(fixedMapping)) {
    fixedInput = fixedInput.replaceAll(mapping[0], mapping[1]);
  }
@lovell lovell added the bug label Sep 8, 2023
@lovell
Copy link
Owner

lovell commented Sep 8, 2023

Thanks for reporting, as I mentioned in #49 (comment) it's probably a good time to vendor the upstream speakingurl and patch all the known bugs, which should allow us to drop the deburr dependency.

Happy to accept a PR to directly add the source code of https://github.com/pid/speakingurl/blob/master/lib/speakingurl.js (with the BSD-3-Clause licence added as a comment/header) instead of using it as a dependency.

@qqilihq
Copy link
Author

qqilihq commented Sep 10, 2023

Thank you for the feedback - I'll see if I find the time to come up with a MR during the next week 👍

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