Skip to content

Table doesn't extend WithAffiliatedKeywords #151

Description

@tcyrus

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions