|
|
@@ -53,7 +53,7 @@ const URL_GROUP_IN_MATCH = 2;
|
|
|
const EMAIL_REG_EXP = /^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;
|
|
|
|
|
|
/**
|
|
|
- * The auto link plugin.
|
|
|
+ * The autolink plugin.
|
|
|
*
|
|
|
* @extends module:core/plugin~Plugin
|
|
|
*/
|
|
|
@@ -89,7 +89,7 @@ export default class AutoLink extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Enables auto-link on typing.
|
|
|
+ * Enables autolink on typing.
|
|
|
*
|
|
|
* @private
|
|
|
*/
|
|
|
@@ -97,12 +97,12 @@ export default class AutoLink extends Plugin {
|
|
|
const editor = this.editor;
|
|
|
|
|
|
const watcher = new TextWatcher( editor.model, text => {
|
|
|
- // 1. Detect "space" after a text with a potential link.
|
|
|
+ // 1. Detect "Space" after a text with a potential link.
|
|
|
if ( !isSingleSpaceAtTheEnd( text ) ) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 2. Check text before last typed "space".
|
|
|
+ // 2. Check text before last typed "Space".
|
|
|
const url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );
|
|
|
|
|
|
if ( url ) {
|
|
|
@@ -131,7 +131,7 @@ export default class AutoLink extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Enables auto-link on <kbd>enter</kbd> key.
|
|
|
+ * Enables autolink on <kbd>Enter</kbd> key.
|
|
|
*
|
|
|
* @private
|
|
|
*/
|
|
|
@@ -157,7 +157,7 @@ export default class AutoLink extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Enables auto-link on <kbd>shift</kbd>+<kbd>enter</kbd> key.
|
|
|
+ * Enables autolink on <kbd>Shift</kbd>+<kbd>Enter</kbd> key.
|
|
|
*
|
|
|
* @private
|
|
|
*/
|
|
|
@@ -208,8 +208,8 @@ export default class AutoLink extends Plugin {
|
|
|
/**
|
|
|
* Applies link on a given range.
|
|
|
*
|
|
|
- * @param {String} url URL to link.
|
|
|
- * @param {module:engine/model/range~Range} range Text range to apply link attribute.
|
|
|
+ * @param {String} url The URL to link.
|
|
|
+ * @param {module:engine/model/range~Range} range Text range to apply the link attribute to.
|
|
|
* @private
|
|
|
*/
|
|
|
_applyAutoLink( url, range ) {
|