You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Take rich text array from a block child that supports rich text and return the plain text.
11
+
// Note: All rich text objects include a plain_text field.
12
+
constgetPlainTextFromRichText=richText=>{
13
+
returnrichText.map(t=>t.plain_text).join("")
14
+
// Note: A page mention will return "Undefined" as the page name if the page has not been shared with the integration. See: https://developers.notion.com/reference/block#mention
15
+
}
16
+
17
+
// Use the source URL and optional caption from media blocks (file, video, etc.)
18
+
constgetMediaSourceText=block=>{
19
+
letsource,caption
20
+
21
+
if(block[block.type].external){
22
+
source=block[block.type].external.url
23
+
}elseif(block[block.type].file){
24
+
source=block[block.type].file.url
25
+
}elseif(block[block.type].url){
26
+
source=block[block.type].url
27
+
}else{
28
+
source="[Missing case for media block types]: "+block.type
29
+
}
30
+
// If there's a caption, return it with the source
0 commit comments