limax icon indicating copy to clipboard operation
limax copied to clipboard

Apostrophe in the custom option is ignored

Open david-benes opened this issue 3 years ago • 2 comments

Expected behavior:

>limax("wendy's", {custom: ["'"]})
wendy's

Actual behavior:

>limax("wendy's", {custom: ["'"]})
wendys

The separateApostrophes option does not help here.

david-benes avatar Jan 31 '21 14:01 david-benes

Hi, this looks like a bug. I guess the following RegEx should exclude any chars that are included in custom:

https://github.com/lovell/limax/blob/ffdcda7eb51de6268d0a5877a1a11d1695045d05/lib/limax.js#L20-L23

Happy to accept a PR if you're able.

lovell avatar Jan 31 '21 15:01 lovell

I figured out that there are more similar issues originating from speakingurl package on which limax depends. Fixing this issue #39 won't help much unless the upstream issue https://github.com/pid/speakingurl/issues/124 is resolved first.

david-benes avatar Feb 11 '21 08:02 david-benes