Skip to content

Commit

Permalink
update (parser): correctly parse rich text cells
Browse files Browse the repository at this point in the history
  • Loading branch information
SantriptaSharma committed Oct 14, 2023
1 parent 9fbe8a5 commit 652d2c7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utils/parse-dining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@ async function ParseXlsx(path: string, year: number): Promise<MessMenu[]>
meals[key].forEach((row) => {
for (let i = 0; i < 7; i++)
{
const name = (row[i + 2] as string ?? "").trim();
let name: string = "";
const thing = row[i + 2];

if (typeof thing == "object") {
if ("richText" in thing) {
name = thing.richText.map(t => t.text).join("");
}
} else if (typeof thing == "string") {
name = thing;
}

if (name.length > 0 && !exclude.includes(name))
{
Expand Down

0 comments on commit 652d2c7

Please sign in to comment.