Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INDI NOTE ref CONC CONT -> <p> #121

Open
jhannah opened this issue Jun 14, 2024 · 9 comments
Open

INDI NOTE ref CONC CONT -> <p> #121

jhannah opened this issue Jun 14, 2024 · 9 comments
Assignees

Comments

@jhannah
Copy link

jhannah commented Jun 14, 2024

Thoughts about HTML transformation:

0 @I1072@ INDI
1 NAME Benjamin Millard /Hannah/
1 SEX M
1 NOTE @X122@
...
0 @X122@ NOTE
1 CONC Compiled by James Bradley Hannah, 19 APRIL 2023 and updated 7 MAY 2024:
1 CONT Nicknamed Ben or Bennie, Benjamin was the youngest of six children born to John Robert and Zylpha Alzada (Byers) while living at “the Hannah farm” south of Mt. Pleasant, Iowa on “old Highway 218.” Friends and family recall him as
1 CONC  tall and slender, fun-loving, and athletic. His high school report cards with grades of mostly As and Bs was consistent with his great love of reading. He married Luella Jean Long on her 19th birthday, September 30, 1923.
1 CONC  Tragically, he suffered an early death, as recorded in the Mt. Pleasant News under the headline, “Large Crowd Attends Service For Ben Hannah,” reading in part: 
1 CONT
1 CONT Friends, relatives, and sympathetic acquaintances completely filled the First Methodist Church [roughly 300 persons] for the memorial service for Benjamin Millard Hannah, truck driver from Mt. Pleasant who lost his life when the
1 CONC  gasoline transport he was driving was involved in a crash nine miles north of Fairfield, in the fog Monday morning…(He) was born November 29, 1920, in Henry County, Iowa. He lost his life February 19, 1951 at the age of thirty
1 CONC  years, two months, and twenty days. Surviving him are his wife, the former Jean Long; three small sons, Johnny, Steven, and Jimmie; his mother, Zylpha Hannah; and four sisters, Mrs. Hamilton Williams, Mt. Pleasant; Mrs. Dale
1 CONC  Cammack, Salem; Mrs. Fred Perrenoud, Winfield; and Mrs. C.A. Hoffman, Minot, N. Dak. His father and a brother, Wayne, preceded him in death, the latter losing his life in a Pennsylvania plane crash, July 4. 1944.

Current render: http://jays.net/genealogy/static-site/I1072.html

Currently the entire note is a single <p> tag, and each CONT adds a <br>. But multiple <br>s in a row are suppressed, so there's no way to get a paragraph break?

My theory is that each CONT should be it's own <p> tag, and each CONC should be appended to previous CONT content with a space. (Currently spaces are not added, causing the HTML to read, for example: September 30, 1923.Tragically,)

@nigelhorne nigelhorne self-assigned this Jun 14, 2024
nigelhorne added a commit that referenced this issue Jun 14, 2024
@nigelhorne
Copy link
Owner

Try it now, please.

@jhannah
Copy link
Author

jhannah commented Jun 14, 2024

From master df7ab4a:

  • Ooo! Paragraphs! Nice! Thanks!
  • The September 30, 1923.Tragically problem still remains though.

@nigelhorne
Copy link
Owner

nigelhorne commented Jun 15, 2024

I believe that is an issue with full_value() within the Gedcom::Item class, it removes the spaces before ged2site even sees the string. This sample program demonstrates it. It may be worth raising a bug report with the author of that module - unless you can think of a work-around within ged2site.

#!/usr/bin/env perl

use strict;
use warnings;
use Gedcom;
use File::Temp;

my $str =<< 'EOF';
0 @I1072@ INDI
1 NAME Benjamin Millard /Hannah/
1 SEX M
1 NOTE @X122@
0 @X122@ NOTE
1 CONC Compiled by James Bradley Hannah, 19 APRIL 2023 and updated 7 MAY 2024:
1 CONT Nicknamed Ben or Bennie, Benjamin was the youngest of six children born to John Robert and Zylpha Alzada (Byers) while living at “the Hannah farm” south of Mt. Pleasant, Iowa on “old Highway 218.” Friends and family recall him as
1 CONC  tall and slender, fun-loving, and athletic. His high school report cards with grades of mostly As and Bs was consistent with his great love of reading. He married Luella Jean Long on her 19th birthday, September 30, 1923.
1 CONC  Tragically, he suffered an early death, as recorded in the Mt. Pleasant News under the headline, “Large Crowd Attends Service For Ben Hannah,” reading in part: 
1 CONT
1 CONT Friends, relatives, and sympathetic acquaintances completely filled the First Methodist Church [roughly 300 persons] for the memorial service for Benjamin Millard Hannah, truck driver from Mt. Pleasant who lost his life when the
1 CONC  gasoline transport he was driving was involved in a crash nine miles north of Fairfield, in the fog Monday morning…(He) was born November 29, 1920, in Henry County, Iowa. He lost his life February 19, 1951 at the age of thirty
1 CONC  years, two months, and twenty days. Surviving him are his wife, the former Jean Long; three small sons, Johnny, Steven, and Jimmie; his mother, Zylpha Hannah; and four sisters, Mrs. Hamilton Williams, Mt. Pleasant; Mrs. Dale
1 CONC  Cammack, Salem; Mrs. Fred Perrenoud, Winfield; and Mrs. C.A. Hoffman, Minot, N. Dak. His father and a brother, Wayne, preceded him in death, the latter losing his life in a Pennsylvania plane crash, July 4. 1944.
EOF

my($fh, $filename) = File::Temp::tempfile();
print $fh $str;
close $fh;

my $ged = Gedcom->new($filename);
my $ben = $ged->get_individual('I1072');
my @notes = $ben->get_record('NOTE');

foreach my $note(@notes) {
	if($note) {
		if(ref($note) eq 'Gedcom::Record') {
			$note = $note->full_value();	# Include CONC records
			if(my $n = $ged->resolve_xref($note)) {
				$note = $n->full_value();
			}
			print __LINE__, ": $note\n";
		}
	}
}

unlink($filename);

@jhannah
Copy link
Author

jhannah commented Jun 15, 2024

Oh dear. Looks like someone cough 🙂 already raised that issue in 2017? pjcj/Gedcom.pm#21 No response... Should I... also fork Gedcom.pm? Seek PAUSE CO-MAINT since there hasn't been a release since 2019?

@nigelhorne
Copy link
Owner

nigelhorne commented Jun 15, 2024

I'd forgotten about that one. I rather think Paul has moved on from supporting the Gedcom module. It would be great if he were to ok co-ownership.

@jhannah
Copy link
Author

jhannah commented Jun 17, 2024

Huh. Well, I changed Gedcom.pm to make myself happy. But that makes the tests unhappy:

t/Basic.pm
1   NOTE Line 1
2     CONT Line 2
2     CONT Lin
2     CONC e 3
2     CONT Line 
2     CONC 4

prove -Ilib t/basic.t
t/basic.t .. 1/1533 # Test 113 got: "Line 1\nLine 2\nLin e 3\nLine 4" (t/Basic.pm at line 31 fail #113)
#     Expected: "Line 1\nLine 2\nLine 3\nLine 4"
#     Line 3 is changed:
#      - "Line 3\n"
#      + "Lin e 3\n"
#  t/Basic.pm line 31 is:     &Test::ok(@a)
t/basic.t .. Failed 1/1533 subtests

Not sure who/where is the authoritative specification nowadays... If it's here https://github.com/FamilySearch/GEDCOM/blob/a6c05e160cb61d959fae7b7dcbea19e332e6684f/changelog.md?plain=1#L36 then CONC doesn't even exist anymore (deprecated).

So... uhh... I guess this'll just be another hack specific to me? In another fork of mine?

jhannah added a commit to jhannah/Gedcom.pm that referenced this issue Jun 17, 2024
@jhannah
Copy link
Author

jhannah commented Jun 19, 2024

I'd forgotten about that one. I rather think Paul has moved on from supporting the Gedcom module. It would be great if he were to ok co-ownership.

Currently PAUSE says Gedcom has 0 co-maintainers. Shall I request he add NHORNE and JHANNAH?

@nigelhorne
Copy link
Owner

That would be great, if Paul is unable or uninterested to keep up the maintenance.

@jhannah
Copy link
Author

jhannah commented Jun 20, 2024

heh. Over in Python land, looks like there's quite a mess of competing parsers of GEDCOM, focusing on various versions of the GEDCOM specs. https://pypi.org/search/?q=gedcom ... I wonder if they all agree on a specific source of specification truth?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants