Skip to content

Commit

Permalink
fix: wrap dataset around table
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin-Alexa Robinson committed May 15, 2024
1 parent b3a58ab commit 7f4a53f
Showing 1 changed file with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,6 @@ export function convertHTMLTablesToDataSet(
return;
}

doc.insertText(
table.start,
"\uFFFC",
AdjacentBoundaryBehaviour.preserveLeading
);
doc.annotations.push(
new ParseAnnotation({ start: table.start - 1, end: table.start })
);

let dataSet = new DataSet({
start: table.start - 1,
end: table.start,
attributes: {
schema: {},
records: [],
},
});

let dataSetSchemaEntries: [name: string, type: ColumnType][] = [];
let columnConfigs: Exclude<Table["attributes"]["columns"], undefined> = [];
let dataRows: Record<string, { slice: string; jsonValue: JSON }>[] = [];
Expand Down Expand Up @@ -232,10 +214,14 @@ export function convertHTMLTablesToDataSet(

tableRows.remove();

dataSet.attributes = {
schema: Object.fromEntries(dataSetSchemaEntries),
records: dataRows,
};
let dataSet = new DataSet({
start: table.start,
end: table.end,
attributes: {
schema: Object.fromEntries(dataSetSchemaEntries),
records: dataRows,
},
});

let offsetTable = new Table({
...table,
Expand Down

0 comments on commit 7f4a53f

Please sign in to comment.