Could it be that the condition check should be if idx is not None: instead? Changing this returns 979-8--84778127-5, which looks a bit more correct, but there might be an off-by-one issue that causes the double hyphen.
(I'm sorry if I'm missing some logic part, I tried to look into the data4mask.py format, but I couldn't understand if ranges with 0s are invalid or have some other special meaning).
When trying to mask
9798847781275
an empty string is returned. When debugging the mask call, it seems like the check at https://github.com/xlcnd/isbnlib/blob/af8ee198a801e64fc9f276193ad5e8d1e119932b/isbnlib/_msk.py#L57 might have a faulty boolean check logic, sinceidx
is 0 (i.e. the group is "found" insideranges
) which is "falsy".Could it be that the condition check should be
if idx is not None:
instead? Changing this returns979-8--84778127-5
, which looks a bit more correct, but there might be an off-by-one issue that causes the double hyphen.(I'm sorry if I'm missing some logic part, I tried to look into the
data4mask.py
format, but I couldn't understand if ranges with0
s are invalid or have some other special meaning).