mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-05-26 15:16:14 +00:00
Show _RUFNAME as a decorated part with GIVN (#276)
Currently function nameDetails simply concatenates various tags to build the full name. The tags _RUFNAME and NICK get some decoration, example: Johannes Karl "Johannes" (Hannes) Buchholz Well, the tag _RUFNAME as a special part of GIVN, which I suggest not to repeat but show decorated within GIVN. Result: "Johannes" Karl (Hannes) Buchholz References: https://wiki.genealogy.net/Name_in_Gedcom https://wiki.genealogy.net/GEDCOM/NAME-Tag#Vereinbarung_zu_Rufnamen
This commit is contained in:
@@ -192,13 +192,20 @@ function noteDetails(noteEntryReference: GedcomEntry, gedcom: GedcomData) {
|
||||
|
||||
function nameDetails(entry: GedcomEntry) {
|
||||
const prefix = entry.tree.find((entry) => entry.tag === 'NPFX')?.data;
|
||||
const given = entry.tree.find((entry) => entry.tag === 'GIVN')?.data;
|
||||
const rufname = entry.tree.find((entry) => entry.tag === '_RUFNAME')?.data;
|
||||
let given = entry.tree.find((entry) => entry.tag === 'GIVN')?.data;
|
||||
let rufname = entry.tree.find((entry) => entry.tag === '_RUFNAME')?.data;
|
||||
const nickname = entry.tree.find((entry) => entry.tag === 'NICK')?.data;
|
||||
const surnamePrefix = entry.tree.find((entry) => entry.tag === 'SPFX')?.data;
|
||||
const surname = entry.tree.find((entry) => entry.tag === 'SURN')?.data;
|
||||
const suffix = entry.tree.find((entry) => entry.tag === 'NSFX')?.data;
|
||||
|
||||
// If _RUFNAME is included in GIVN, then replace this part in GIVN with this part in quotation marks,
|
||||
// so that this name is not shown twice.
|
||||
if (given && rufname && given.includes(rufname)) {
|
||||
given = given.replace(rufname, `"${rufname}"`);
|
||||
rufname = undefined;
|
||||
}
|
||||
|
||||
const fullNameParts = [
|
||||
prefix,
|
||||
given,
|
||||
|
||||
Reference in New Issue
Block a user