fix invalid export (and import) of Gedcom EMAIL records (#455)

Gedcom spec 5.5 requires '@' in general text to be doubled '@@'
fixes #10167
This commit is contained in:
Paul Culley
2017-09-09 17:33:23 -05:00
committed by Sam Manzi
parent c6f45af3f1
commit 231b15eca1
4 changed files with 22 additions and 17 deletions

View File

@@ -278,6 +278,9 @@ class GedcomWriter(UpdateCallback):
# break the line into multiple lines if a newline is found
textlines = textlines.replace('\n\r', '\n')
textlines = textlines.replace('\r', '\n')
# Need to double '@' See Gedcom 5.5 spec 'any_char'
if not textlines.startswith('@'): # avoid xrefs
textlines = textlines.replace('@', '@@')
textlist = textlines.split('\n')
token_level = level
for text in textlist: