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
T/44: Show mention after softBreak and some punctuation characters #61
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e0bf6e3
MentionUI will be shown when marker is typed after a soft break.
jodator e64b998
Whitelist some characters to enable mention UI after them.
jodator 946721e
Update the regex for mention text watcher to ES2018 syntax.
jodator 14de30b
Merge branch 'master' into t/44
jodator 53d3d23
Fix pattern for $ marker.
jodator 117c7f8
Add tests for ES2018 RegExp unicode property escapes.
jodator 52fa52e
Add missing dev dependency.
jodator 1ff27df
Add RegExp escapes for [ and ( in pattern string.
jodator 7fcbccf
Fix RegExp escape for brackets.
jodator f216cd5
Fix RegExp unicode property escapes feature detection for Edge.
jodator 42bb621
Update tests for env.isEdge check.
jodator ced456e
Update env.isEdge stub comment.
jodator 51b59c8
Merge branch 'master' into t/44
jodator b9ebfa9
Internal: Remove browser sniffing for edge and instead use feature de…
mlewand a17d84f
Internal: Restructured the code to achieve 100% code coverage.
mlewand fcaeb31
Internal: Final adjustments to achieve 100% code coverage.
mlewand 7d2f6c4
Tests: Reused common code for RegExp punctuation groups feature detec…
mlewand bb06299
Update src/mentionui.js docs.
jodator ef27aa7
Update tests/mentionui.js docs.
jodator 1103d50
Update src/mentionui.js docs.
jodator cfcc99f
Code style fixes.
jodator 20a4ec0
Update internal docs of createRegExp function.
jodator 10a4276
Add punctuation initial quote unicode group support.
jodator eba5b82
Merge branch 't/44b' into t/44
jodator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for adding a placeholder-like widget in this manual test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I wanted to test how this behaves with not only a
<softBreak>
but also with inline widget. (potential errors, etc).