8
0
Pārlūkot izejas kodu

Merge pull request #1726 from ckeditor/t/1725

Internal: Snippet Adapter does not require a full path to match snippets that should be built. Closes #1725.
Piotrek Koszuliński 6 gadi atpakaļ
vecāks
revīzija
838a4e1265
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4 3
      scripts/docs/snippetadapter.js

+ 4 - 3
scripts/docs/snippetadapter.js

@@ -212,10 +212,11 @@ function filterWhitelistedSnippets( snippets, whitelistedSnippets ) {
 
 	// Find all snippets that matched to specified criteria.
 	for ( const snippetData of snippets ) {
-		const matchToPatterns = whitelistedSnippets.some( pattern => minimatch( snippetData.snippetName, pattern ) );
+		const shouldBeBuilt = whitelistedSnippets.some( pattern => {
+			return minimatch( snippetData.snippetName, pattern ) || snippetData.snippetName.includes( pattern );
+		} );
 
-		// Snippet should be built.
-		if ( matchToPatterns ) {
+		if ( shouldBeBuilt ) {
 			snippetsToBuild.add( snippetData );
 		}
 	}