From c21d88ce8912421c25589a75cd812d1e5eb94557 Mon Sep 17 00:00:00 2001 From: Tim G L Lyons Date: Thu, 13 Jun 2013 18:06:10 +0000 Subject: [PATCH] 0000860: GEDCOM: Space in gramps id fails to properly export/import svn: r22499 --- src/plugins/lib/libgedcom.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/lib/libgedcom.py b/src/plugins/lib/libgedcom.py index 9f1600d0e..03ce1ae55 100644 --- a/src/plugins/lib/libgedcom.py +++ b/src/plugins/lib/libgedcom.py @@ -726,11 +726,19 @@ class Lexer(object): level = int(line[0]) # there should only be one space after the level, # but we can ignore more, + line = line[2].lstrip(' ') # then split into tag+delim+line_value # or xfef_id+delim+rest - line = line[2].lstrip(' ').partition(' ') - tag = line[0] - line_value = line[2] + # the xref_id can have spaces in it + if line.startswith('@'): + line = line.split('@', 2) + # line is now [None, alphanum+pointer_string, rest] + tag = '@' + line[1] + '@' + line_value = line[2] + else: + line = line.partition(' ') + tag = line[0] + line_value = line[2] except: continue