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

It is not possible to set autolink_urlRegex and autolink_emailRegex properties of autolink plugin #3156

Closed
jswiderski opened this issue Jun 7, 2019 · 1 comment · Fixed by #3930
Labels
plugin:autolink The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@jswiderski
Copy link
Contributor

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Download CKEditor with autolink plugin.
  2. Use one of below code versions to configure CKEditor:
CKEDITOR.config.autolink_urlRegex = /^(https?|ftp|file):\/\/(-\.)?([^\s\/?\.#]+\.?)+(\/[^\s]*)?[^\s\.,]$/i;
var editor = CKEDITOR.replace( 'editor1', {extraPlugins : 'autolink'});
var editor = CKEDITOR.replace( 'editor1', {
    extraPlugins : 'autolink',
    autolink_urlRegex : /^(https?|ftp|file):\/\/(-\.)?([^\s\/?\.#]+\.?)+(\/[^\s]*)?[^\s\.,]$/i
});
  1. Load CKEditor and type e.g. file://C:/test/ and press space
    (I know the URL is invalid and the regex should be changed becaue it match file:///C:/test/ but this is just for simplicity of testing)

Expected result

Text should get linked.

Actual result

Text doesn't get linked

Other details

This is happening because plugin code uses e.g. CKEDITOR.config.autolink_emailRegex instead of editor.config.autolink_emailRegex:
https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/autolink/plugin.js#L128
https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/autolink/plugin.js#L103
https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/autolink/plugin.js#L127
what makes impossible to overwrite values for these properties.

  • Browser: Any
  • OS: Any
  • CKEditor version: 4.11.0+
  • Installed CKEditor plugins: autolink
@jswiderski jswiderski added the type:bug A bug. label Jun 7, 2019
@jacekbogdanski jacekbogdanski added plugin:autolink The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. labels Jun 7, 2019
@jacekbogdanski
Copy link
Member

Fixed in #3930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:autolink The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants