https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34860

--- Comment #3 from Marcel de Rooy <[email protected]> ---
Code with optional suffix stripping:

function isbn_check ( subfield, strip_suffix ) {
    // Remove hyphens from isbn part, handle suffix by split on space
    var split_field = subfield.split( ' ', 2 );
    var isbn = split_field[0].replace( /[-]/g, '' );
    var suffix;
    if( strip_suffix ) suffix = '';
    else suffix = split_field[1] ? ' ' + split_field[1] : '';

    if ( isbn.match(/^\d{9}(\d{3})?[0-9X]$/) ) {
        if( valid_isbn_check_digit(isbn) ) return [ 1, isbn + suffix ];
    }
    return [ 0, isbn + suffix ];
}

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to