This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Mention can now also be preceded by a bracket, quote or soft bre…
…ak. Closes #44.
- Loading branch information
Showing
6 changed files
with
276 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/** | ||
* @module mention/featuredetection | ||
*/ | ||
|
||
/** | ||
* Holds feature detection resolutions used by the mention plugin. | ||
* | ||
* @protected | ||
* @namespace | ||
*/ | ||
export default { | ||
/** | ||
* Indicates whether the current browser supports ES2018 Unicode punctuation groups `\p{P}`. | ||
* | ||
* @type {Boolean} | ||
*/ | ||
isPunctuationGroupSupported: ( function() { | ||
let punctuationSupported = false; | ||
// Feature detection for Unicode punctuation groups. It's added in ES2018. Currently Firefox and Edge does not support it. | ||
// See https://github.com/ckeditor/ckeditor5-mention/issues/44#issuecomment-487002174. | ||
|
||
try { | ||
punctuationSupported = '.'.search( new RegExp( '[\\p{P}]', 'u' ) ) === 0; | ||
} catch ( error ) { | ||
// Firefox throws a SyntaxError when the group is unsupported. | ||
} | ||
|
||
return punctuationSupported; | ||
}() ) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.