Lines 48-57
define( [ 'marc-record' ], function( MARC ) {
Link Here
|
48 |
TextToRecord: function( text ) { |
48 |
TextToRecord: function( text ) { |
49 |
var record = new MARC.Record(); |
49 |
var record = new MARC.Record(); |
50 |
var errors = []; |
50 |
var errors = []; |
51 |
|
|
|
52 |
$.each( text.split('\n'), function( i, line ) { |
51 |
$.each( text.split('\n'), function( i, line ) { |
|
|
52 |
if (line === "") {return}; |
53 |
var tagNumber = line.match( /^([A-Za-z0-9]{3}) / ); |
53 |
var tagNumber = line.match( /^([A-Za-z0-9]{3}) / ); |
54 |
|
|
|
55 |
if ( !tagNumber ) { |
54 |
if ( !tagNumber ) { |
56 |
errors.push( { type: 'noTag', line: i } ); |
55 |
errors.push( { type: 'noTag', line: i } ); |
57 |
return; |
56 |
return; |