Explorar el Código

Add word boundary matchers around GLTFLoader regular expressions to avoid replacing partial word matches (#9897)

Rich Tibbett hace 8 años
padre
commit
baff496795
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      examples/js/loaders/GLTFLoader.js

+ 1 - 1
examples/js/loaders/GLTFLoader.js

@@ -664,7 +664,7 @@ var replaceTHREEShaderAttributes = function( shaderText, technique ) {
 
 		var semantic = param.semantic;
 
-		var regEx = new RegExp( pname, "g" );
+		var regEx = new RegExp( "\\b" + pname + "\\b", "g" );
 
 		switch ( semantic ) {