提交 89b3d0ba 编写于 作者: D Daniel Hritzkiv 提交者: Mr.doob

Normalize all line endings in an OBJ file (#9633)

`String.prototype.replace` only targets and replaces the first occurrence of a string. By using a regex with the global flag, all instances of a pattern are replaced.
上级 2eeee0a4
......@@ -412,7 +412,7 @@ THREE.OBJLoader.prototype = {
if ( text.indexOf( '\r\n' ) !== - 1 ) {
// This is faster than String.split with regex that splits on both
text = text.replace( '\r\n', '\n' );
text = text.replace( /\r\n/g, '\n' );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册