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

Mentions are not matching unicode/diacritic characters #2491

Closed
Adrienb91 opened this issue Oct 17, 2018 · 5 comments
Closed

Mentions are not matching unicode/diacritic characters #2491

Adrienb91 opened this issue Oct 17, 2018 · 5 comments
Assignees
Labels
plugin:mentions The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Milestone

Comments

@Adrienb91
Copy link

Adrienb91 commented Oct 17, 2018

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Use CKEDITOR 4.10 with mentions plugin
  2. Include mentions data with accents like 'Céline TEST'
  3. Try to use mentions with data typing '@Cé'

Expected result

Mentions propose entry 'Céline TEST'

Actual result

No results

Other details

It seems due to emphasis/accents
I've tried with direct data in array or with function feed.

I think we would have same results trying with accents or not (@cel or @Cél must return same results).
It can be solved with a new regexp parameter to apply to request and data ?

Thanks per advance !

  • Browser: Any
  • CKEditor version: 4.10
  • Installed CKEditor plugins: Mentions
@Adrienb91
Copy link
Author

Capture
ckeditor_mentions_accent_pb

@mlewand mlewand self-assigned this Oct 18, 2018
@mlewand
Copy link
Contributor

mlewand commented Oct 18, 2018

I can confirm the issue. Looks like it happens with pretty much any unicode characters, I was able to reproduce the problem with some Polish characters too.

I have prepared a codepen demo that I'll put in repro steps above.

@mlewand mlewand added type:bug A bug. status:confirmed An issue confirmed by the development team. plugin:mentions The plugin which probably causes the issue. labels Oct 18, 2018
@mlewand
Copy link
Contributor

mlewand commented Oct 18, 2018

@Adrienb91 I had a quick look at this and I was able to come with a workaround to this problem, you can temporarily apply it yourself before we come with a upstream fix, it's enough to adjust CKEDITOR.plugins.mentions.configDefinition.pattern property, like so:

mentions: [ {
	feed: ['Anna', 'Anęmość', 'Thomas', 'John'],
	minChars: 0,
	pattern: /\@[a-zA-Z0-9_À-ž]*$/
} ]

That should cover you with diacritics you're looking for. Here's an example (it uses Polish diacritics but feel free to adjust the config to include any other entries): https://codepen.io/mlewand/pen/PyRQOE

It does not cover all utf8 chars, but it can be extended in case of need.

@mlewand mlewand added the target:minor Any docs related issue that can be merged into a master or major branch. label Oct 18, 2018
@mlewand mlewand added this to the Backlog milestone Oct 18, 2018
@mlewand mlewand removed their assignment Oct 18, 2018
@mlewand mlewand changed the title Mentions plugins don't work with accents Mentions are not matching unicode/diacritic characters Oct 18, 2018
@Adrienb91
Copy link
Author

@mlewand : Thanks a lot, it works like a charm !

I've added spaces and & character : pattern: /\@[a-zA-Z0-9_\s&À-ž]*$/

@mlewand
Copy link
Contributor

mlewand commented Oct 19, 2018

@Adrienb91 I'm glad it has worked for you. Meanwhile I'm leaving the issue open, as it is valid and the default matching should be changed to also include mentioned diacritics characters.

Until it gets patched the easiest way is to adjust the pattern in the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:mentions The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

3 participants