|
|
@@ -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 autolinking 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 autolinking on the <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 autolinking on the <kbd>Shift</kbd>+<kbd>Enter</kbd> keyboard shortcut.
|
|
|
*
|
|
|
* @private
|
|
|
*/
|
|
|
@@ -184,7 +184,7 @@ export default class AutoLink extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Checks passed range if it contains a linkable text.
|
|
|
+ * Checks if the passed range contains a linkable text.
|
|
|
*
|
|
|
* @param {module:engine/model/range~Range} rangeToCheck
|
|
|
* @private
|
|
|
@@ -206,10 +206,10 @@ export default class AutoLink extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Applies link on a given range.
|
|
|
+ * Applies a 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 The text range to apply the link attribute to.
|
|
|
* @private
|
|
|
*/
|
|
|
_applyAutoLink( url, range ) {
|