|
1 | 1 | <template> |
2 | 2 | <component |
3 | 3 | v-if="isPageLink && hasPageLinkOptions" |
4 | | - class="notion-page-link" |
| 4 | + class="notion-link" |
5 | 5 | v-bind="pageLinkProps(decoratorValue)" |
6 | 6 | :is="pageLinkOptions.component" |
7 | 7 | > |
|
14 | 14 | :href="mapPageUrl(decoratorValue)" |
15 | 15 | >{{ pageLinkTitle }}</a |
16 | 16 | > |
| 17 | + <component |
| 18 | + v-else-if="decoratorKey === 'a' && hasPageLinkOptions && isInlinePageLink" |
| 19 | + class="notion-link" |
| 20 | + v-bind="pageLinkProps(decoratorValue.slice(1))" |
| 21 | + :is="pageLinkOptions.component" |
| 22 | + > |
| 23 | + <NotionDecorator :content="nextContent" v-bind="pass" /> |
| 24 | + </component> |
| 25 | + <a |
| 26 | + v-else-if="decoratorKey === 'a' && isInlinePageLink" |
| 27 | + class="notion-link" |
| 28 | + :target="target" |
| 29 | + :href="mapPageUrl(decoratorValue.slice(1))" |
| 30 | + > |
| 31 | + <NotionDecorator :content="nextContent" v-bind="pass" /> |
| 32 | + </a> |
| 33 | + <a |
| 34 | + v-else-if="decoratorKey === 'a'" |
| 35 | + class="notion-link" |
| 36 | + :target="target" |
| 37 | + :href="decoratorValue" |
| 38 | + > |
| 39 | + <NotionDecorator :content="nextContent" v-bind="pass" /> |
| 40 | + </a> |
17 | 41 | <span v-else-if="decorators.length === 0">{{ text }}</span> |
18 | 42 | <span v-else-if="decoratorKey === 'h'" :class="'notion-' + decoratorValue" |
19 | 43 | ><NotionDecorator :content="nextContent" v-bind="pass" /> |
|
30 | 54 | <s v-else-if="decoratorKey === 's'"> |
31 | 55 | <NotionDecorator :content="nextContent" v-bind="pass" /> |
32 | 56 | </s> |
33 | | - <a |
34 | | - v-else-if="decoratorKey === 'a'" |
35 | | - class="notion-link" |
36 | | - :target="target" |
37 | | - :href="decoratorValue" |
38 | | - > |
39 | | - <NotionDecorator :content="nextContent" v-bind="pass" /> |
40 | | - </a> |
41 | 57 | <component |
42 | 58 | v-else-if="decoratorKey === 'e'" |
43 | 59 | :is="'katex-element'" |
@@ -79,6 +95,9 @@ export default { |
79 | 95 | isPageLink() { |
80 | 96 | return this.text === "‣"; |
81 | 97 | }, |
| 98 | + isInlinePageLink() { |
| 99 | + return this.decoratorValue && this.decoratorValue[0] === "/"; |
| 100 | + }, |
82 | 101 | pageLinkTitle() { |
83 | 102 | return ( |
84 | 103 | this.blockMap?.[this.decoratorValue]?.value?.properties |
|
0 commit comments