xlcnd / isbnlib

python library to validate, clean, transform and get metadata of ISBN strings (for devs).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dashes in isbns cause problem in normal level

C7DAFBB7 opened this issue · comments

Whenever a string contains '-97' get_isbnlike() returns wonky results in normal level.

For example for "Fashion 101 - A Crash Course in Clothing"

isbnlib.get_isbnlike('978-0-9790173-4-6', level='normal') => ['9790173-4-6']

which should return ['978-0-9790173-4-6'] or possibly ['978-0-9790173-4-6', '9790173-4-6']

for 'Superbritánico and the Queen's Birthday'

isnblib.getisbnlike(''978-9788461784') => ['9788461784']

The problem seems to be caused by this bit of code introduced to solve issue #60

    text = text.replace('-97', '- 97')

Thank you

commented

Thanks! It is 'fixed'!