Skip to content

Commit f1a9b45

Browse files
committed
addl support
1 parent 141d591 commit f1a9b45

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/api/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const getNotionValue = (
2626
): RowContentType => {
2727
switch (type) {
2828
case "text":
29+
// return val; // includes formatted content like bold and anchors, but a pain to parse
2930
return getTextContent(val);
3031
case "person":
3132
return (
@@ -55,11 +56,15 @@ export const getNotionValue = (
5556
.filter(([symbol]) => symbol === "‣")
5657
.map(([_, relation]) => relation![0][1] as string);
5758
case "file":
59+
if(!val[0][1]) // file is embedded link
60+
return [{'name': val[0][0].toString(), 'url': val[0][0].toString()}]
61+
5862
return val
5963
.filter((v) => v.length > 1)
6064
.map((v) => {
61-
const rawUrl = v[1]![0][1] as string;
6265

66+
const rawUrl = v[1]![0][1] as string;
67+
6368
const url = new URL(
6469
`https://www.notion.so${
6570
rawUrl.startsWith("/image")

src/routes/collection.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ export const getCollectionData = async (
6464
}
6565

6666
const name: String = collection.value.name.join('')
67-
68-
69-
7067

7168
return { rows, schema: collectionRows, name, tableArr};
7269
};

0 commit comments

Comments
 (0)