Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/itchy-eyes-make.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"gedcom": patch
---

Allow all text in plain text fields

Plaintext fields (CONC, CONT, and NOTE) all allow any kind of text
and do not match for pointers.
10 changes: 6 additions & 4 deletions lib/parse-to-unist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,15 @@ test("parser - concatenation", () => {
);
});

test("parser - concatenation", () => {
expect(() => {
test("parser - concatenation with @ symbols", () => {
expect(
parse(`
0 SOUR Waters, Henry F., Genealogical Gleanings in England: Abstracts of W
1 CONC ills Relating to Early American Families. 2 vols., reprint 1901, 190
1 CONC @123@`).children[0].data?.value;
}).toThrow();
1 CONC @123@`).children[0].data?.value,
).toEqual(
"Waters, Henry F., Genealogical Gleanings in England: Abstracts of Wills Relating to Early American Families. 2 vols., reprint 1901, 190@123@",
);
});

test("parser - error, too large a jump", (t) => {
Expand Down
3 changes: 2 additions & 1 deletion lib/tokenize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ export function tokenize(buf: string, lineNumber: number): Line {

if (xref_id) line.xref_id = xref_id;

const plaintext = tag === "CONC" || tag === "CONT" || tag === "NOTE";
const delim = buf.match(rDelim);
if (delim) {
buf = buf.substring(delim[0].length);
const pointer_match = buf.match(rPointer);
const pointer_match = !plaintext && buf.match(rPointer);
const value_match = buf.match(rLineItem);
if (pointer_match) {
line.pointer = pointer_match[0];
Expand Down