8
0
Pārlūkot izejas kodu

Docs: Improved internal createRegExp() helper docs.

Aleksander Nowodzinski 6 gadi atpakaļ
vecāks
revīzija
b781d1668b
1 mainītis faili ar 5 papildinājumiem un 4 dzēšanām
  1. 5 4
      packages/ckeditor5-mention/src/mentionui.js

+ 5 - 4
packages/ckeditor5-mention/src/mentionui.js

@@ -559,10 +559,11 @@ export function createRegExp( marker, minimumCharacters ) {
 	const openAfterCharacters = featureDetection.isUnicodeGroupSupported ? '\\p{Ps}\\p{Pi}"\'' : '\\(\\[{"\'';
 	const mentionCharacters = featureDetection.isUnicodeGroupSupported ? '\\p{L}\\p{N}' : 'a-zA-ZÀ-ž0-9';
 
-	// The pattern is build from 3 groups:
-	// - 0 (non-capturing): Opening sequence - start of line, space or opening punctuation charcter like ( or ".
-	// - 1: Marker character.
-	// - 2: Mention input (with support of minimal lenght to trigger UI)
+	// The pattern consists of 3 groups:
+	// - 0 (non-capturing): Opening sequence - start of the line, space or opening punctuation character like ( or ",
+	// - 1: The marker character,
+	// - 2: Mention input (taking the minimal length into consideration to trigger the UI),
+	//
 	// The pattern matches up to the caret (end of string switch - $).
 	//               (0:      opening sequence       )(1:  marker   )(2:                typed mention                 )$
 	const pattern = `(?:^|[ ${ openAfterCharacters }])([${ marker }])([_${ mentionCharacters }]${ numberOfCharacters })$`;