Explorar el Código

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 hace 6 años
padre
commit
838a4e1265
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  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 );
 		}
 	}