From 841ab24a82fa1d9575b40875a4391f2ebfc19ba1 Mon Sep 17 00:00:00 2001 From: Gary Burton Date: Wed, 23 Apr 2008 21:46:07 +0000 Subject: [PATCH] Allow Gedcom lexer to pad with a space when joining CONC lines to empty NOTE lines. Bug #2100. svn: r10634 --- src/GrampsDbUtils/_GedcomLex.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/GrampsDbUtils/_GedcomLex.py b/src/GrampsDbUtils/_GedcomLex.py index ec596de89..31d980fbf 100644 --- a/src/GrampsDbUtils/_GedcomLex.py +++ b/src/GrampsDbUtils/_GedcomLex.py @@ -346,7 +346,13 @@ class Reader: def __fix_token_conc(self, data): line = self.current_list[0] - new_value = line[2] + data[2] + if len(line[2]) == 4: + # The previous line contains only a tag and no data so concat a + # space to separate the new line from the tag. This prevents the + # first letter of the new line being lost later. + new_value = line[2] + ' ' + data[2] + else: + new_value = line[2] + data[2] self.current_list[0] = (line[0], line[1], new_value, line[3], line[4]) def __readahead(self):