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

full_value handling of CONC on FindMyPast Gedcoms #21

Open
nigelhorne opened this issue Dec 15, 2017 · 2 comments
Open

full_value handling of CONC on FindMyPast Gedcoms #21

nigelhorne opened this issue Dec 15, 2017 · 2 comments

Comments

@nigelhorne
Copy link

This is a bug in FMP not in Gedcom, but since they are very unlikely to help I thought it best asking here for help.

In Item.pm there is this code:


sub full_value {
    my $self = shift;
    my $value = $self->{value};
    $value =~ s/[\r\n]+$// if defined $value;
    for my $item (@{$self->_items}) {
        my $v = defined $item->{value} ? $item->{value} : "";
        $v =~ s/[\r\n]+$//;
        $value .= "\n$v" if $item->{tag} eq "CONT";
        $value .=    $v  if $item->{tag} eq "CONC";
    }
    $value
}

The problem is that if a NOTE record (and perhaps others) or CONC record ends with a space, FMP (and perhaps ACOM) strips it which means that words can run on. I don't know how, but somehow it would be great if that could be worked around.

Maybe something horrible such as this:

        $value .= "\n$v" if $item->{tag} eq "CONT";
        $value .= ' '  if(($item->{tag} eq 'CONC') && ($value !~ /\s$/));  # Work around FMP
        $value .=    $v  if $item->{tag} eq "CONC";
jhannah added a commit to jhannah/Gedcom.pm that referenced this issue Jun 17, 2024
@pjcj
Copy link
Owner

pjcj commented Jul 7, 2024

@nigelhorne jhannah I've finally carved out a little time to look at Gedcom.pm and created a solution for this.

I don't really want to add anything that always runs, since I think the current behaviour is compliant with the GEDCOM standard and I wouldn't like to break that. But perl has a long and illustrious history of working around broken software. So I have essentially added the proposed fix behind a feature flag.

When you create your GEDCOM object you can specify the option add_conc_space and if that value is true then a space will be added to the value before the CONC value is added, if one is not already there.

I think this is what's needed. The fix is on the dev branch if you'd like to take a look. If it does what's needed I'll make a new release.

@nigelhorne
Copy link
Author

Thanks, I'll take a look. I understand. In the real world, we have to realise that, sadly, genealogy websites do not adhere to the Gedcom standard, sigh.

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