Fix the subitems formatter function to split only when the period is surrounded by non-white space and not another period

This commit is contained in:
Charles Haley 2011-12-07 17:18:39 +01:00
parent ad23762ae6
commit 428313d1ea

View File

@ -720,12 +720,12 @@ class BuiltinSubitems(BuiltinFormatterFunction):
items = [v.strip() for v in val.split(',')]
rv = set()
for item in items:
component = item.split('.')
components = re.split(r'(?<=[^\.\s])\.(?=[^\.\s])', item, flags=re.U)
try:
if ei == 0:
rv.add('.'.join(component[si:]))
rv.add('.'.join(components[si:]))
else:
rv.add('.'.join(component[si:ei]))
rv.add('.'.join(components[si:ei]))
except:
pass
return ', '.join(sorted(rv, key=sort_key))