File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,17 @@ export class RichTextRenderer {
60
60
}
61
61
// todo: support for mentions is probably useful, for cross-page links?
62
62
case "text" :
63
- const text = this . wrap ( mod , rt . text . content ) ;
64
- return rt . text . link
65
- ? this . linkRenderer . renderUrlLink ( text , rt . text . link . url )
66
- : text ;
63
+ // TODO move to above switch statement after upgrading notion client to newest version
64
+ // switch(rt.mention.type) case: "link_preview" not supported, because types are outdated in @notionhq/client v0.3.x
65
+ if ( rt . text === undefined && rt . href !== undefined ) {
66
+ const link_text = this . wrap ( mod , rt . plain_text )
67
+ return this . linkRenderer . renderUrlLink ( link_text , rt . href )
68
+ } else {
69
+ const text = this . wrap ( mod , rt . text . content ) ;
70
+ return rt . text . link
71
+ ? this . linkRenderer . renderUrlLink ( text , rt . text . link . url )
72
+ : text ;
73
+ }
67
74
}
68
75
}
69
76
You can’t perform that action at this time.
0 commit comments