parseTable discards affiliated for TableOrg but keeps it for TableTableEl:
|
if (tableType === 'org') { |
|
return u( |
|
'table', |
|
this.addPosition( |
|
{ tableType, tblfm, contentsBegin, contentsEnd }, |
|
start, |
|
end |
|
), |
|
[] |
|
); |
|
} else { |
|
return u( |
|
'table', |
|
this.addPosition( |
|
{ |
|
affiliated, |
|
tableType, |
|
tblfm, |
|
value: this.r.substring(contentsBegin, contentsEnd), |
|
}, |
|
start, |
|
end |
|
) |
|
); |
|
} |
The types for both Tables doesn't extend WithAffiliatedKeywords:
|
export type Table = TableOrg | TableTableEl; |
|
export interface TableOrg extends GreaterElement { |
|
type: 'table'; |
|
/** Formulas associated to the table, if any. */ |
|
tblfm: string | null; |
|
tableType: 'org'; |
|
children: TableRow[]; |
|
} |
|
export interface TableTableEl extends Node { |
|
type: 'table'; |
|
/** Formulas associated to the table, if any. */ |
|
tblfm: string | null; |
|
tableType: 'table.el'; |
|
/** Raw `table.el` table. */ |
|
value: string; |
|
} |
TableOrg and TableTableEl should both extend WithAffiliatedKeywords so that they can be labeled using NAME (docs)
parseTablediscardsaffiliatedforTableOrgbut keeps it forTableTableEl:uniorg/packages/uniorg-parse/src/parser.ts
Lines 1415 to 1439 in 71f7546
The types for both
Tables doesn't extendWithAffiliatedKeywords:uniorg/packages/uniorg/src/index.ts
Lines 256 to 271 in 71f7546
TableOrgandTableTableElshould both extendWithAffiliatedKeywordsso that they can be labeled usingNAME(docs)