We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74c0864 commit 1b6b969Copy full SHA for 1b6b969
lib/index.js
@@ -34,13 +34,19 @@ module.exports.parse = function( output ){
34
if( index == 0 ){
35
var fields = line.split( /\s+/ );
36
// 保存各字段的开始和结束位置
37
+ var fieldIndex = 0;
38
fields.forEach(function( field ){
39
40
if( field ){
41
var info = titleInfo[ field ] = {};
42
// 记录字段值的开始和结束
- info.titleBegin = line.indexOf( field );
43
+ if ( fieldIndex == 0 ){
44
+ info.titleBegin = 0;
45
+ }else{
46
+ info.titleBegin = line.indexOf( field );
47
+ }
48
info.titleEnd = info.titleBegin + field.length - 1;
49
+ fieldIndex++;
50
}
51
});
52
0 commit comments