geneweb / geneweb

GeneWeb is a free (as in free speech) genealogy software with a web interface created by Daniel de Rauglaudre.
GNU General Public License v2.0
300 stars 92 forks source link

gwb2ged, export of comment with <pre> #719

Open PSLLSP opened 5 years ago

PSLLSP commented 5 years ago

Report for geneweb 6.08. I use sample DB from http://genealogyoflife.com/tng/gedcom/HarryPotter.ged

GWB is created with command

cd "/var/lib/geneweb"
/usr/bin/ged2gwb -f "/home/user/gene-test/HarryPotter.ged" -o potter1 -uin > comm.log

And geneweb GWB is exported to GEDCOM:

cd "/var/lib/geneweb"
/usr/bin/gwb2ged potter1 -o potter1.ged > comm.log

Import GEDCOM back, create GWB "potter2"

cd "/var/lib/geneweb"
/usr/bin/ged2gwb -f "potter1.ged" -o potter2 -uin > comm.log

The issue. Formated comments are broken, formatting is lost. Compare pages from potter1 and potter2: http://localhost:2317/potter1?p=harry;n=potter http://localhost:2317/potter2?p=harry;n=potter

An example, there was a comment

<pre>
-- GEDCOM (FAM) --
1 CHIL @I00014@
2 _FREL Natural 
2 _MREL Natural
1 CHIL @I00015@
2 _FREL Natural
2 _MREL Natural
1 CHIL @I00016@
2 FREL Natural
2 _MREL Natural
</pre>

That is exported to GEDCOM file and formating is lost:

1 NOTE <pre> -- GEDCOM (FAM) -- 1 CHIL @I00014@ 2 _FREL Natural 2 _MREL Natur
2 CONC al 1 CHIL @I00015@ 2 _FREL Natural 2 _MREL Natural 1 CHIL @I00016@ 2 _
2 CONC FREL Natural 2 _MREL Natural </pre>

This is what is in comment after import:

<pre> -- GEDCOM (FAM) -- 1 CHIL @I00014@ 2 _FREL Natural 2 _MREL Natural 1 CHIL @I00015@ 2 _FREL Natural 2 _MREL Natural 1 CHIL @I00016@ 2 _FREL Natural 2 _MREL Natural </pre>

Better way of export, should use CONT:

1 NOTE <pre>
2 CONT -- GEDCOM (FAM) --
2 CONT 1 CHIL @I00014@
2 CONT 2 _FREL Natural
2 CONT 2 _MREL Natural
2 CONT 1 CHIL @I00015@
2 CONT 2 _FREL Natural
2 CONT 2 _MREL Natural
2 CONT 1 CHIL @I00016@
2 CONT 2 _FREL Natural
2 CONT 2 _MREL Natural
2 CONT </pre>

Even this is not perfect, it is imported back as:

<pre><br>
-- GEDCOM (FAM) --<br>
1 CHIL @I00014@<br>
2 _FREL Natural<br>
2 _MREL Natural<br>
1 CHIL @I00015@<br>
2 _FREL Natural<br>
2 _MREL Natural<br>
1 CHIL @I00016@<br>
2 FREL Natural<br>
2 _MREL Natural<br>
</pre>

Newer version of geneweb supports markdown, such comments will be affected too when formating is lost.

## Some comment
* item1
* item2

Summary. In the ideal way, Geneweb should be able to read back GEDCOM file it generated without any issue, no information should be lost. I know I can export and import GWB with gwu and gwc commands..

a2line commented 5 years ago

I agree that a ged2gwb > gwb2ged pass should be lossless for the gedcom itself. I think there's already open issues for this like #172 (and #284 seems also linked).

hgouraud commented 3 years ago

Related to issue #1002. Should be fixed after PR #1067.