Skip to content

Commit 7e0d841

Browse files
committed
add hrefs to mentions
1 parent 99efc13 commit 7e0d841

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

src/models/tests.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ fn rich_text_mention_user_person() {
9292
},
9393
}
9494
},
95+
href: None,
9596
}
9697
)
9798
}
@@ -122,6 +123,7 @@ fn rich_text_mention_date() {
122123
time_zone: None,
123124
}
124125
},
126+
href: None,
125127
}
126128
)
127129
}
@@ -154,6 +156,7 @@ fn rich_text_mention_date_with_time() {
154156
time_zone: None,
155157
}
156158
},
159+
href: None,
157160
}
158161
)
159162
}
@@ -186,6 +189,7 @@ fn rich_text_mention_date_with_end() {
186189
time_zone: None,
187190
}
188191
},
192+
href: None,
189193
}
190194
)
191195
}
@@ -223,6 +227,7 @@ fn rich_text_mention_date_with_end_and_time() {
223227
time_zone: None,
224228
}
225229
},
230+
href: None,
226231
}
227232
)
228233
}
@@ -250,7 +255,8 @@ fn rich_text_mention_page() {
250255
page: MentionId {
251256
id: PageId::from_str("c81ee776-2752-4e98-aa66-c37bd4ba9b8d").unwrap()
252257
}
253-
}
258+
},
259+
href: Some("https://www.notion.so/c81ee77627524e98aa66c37bd4ba9b8d".to_string())
254260
}
255261
);
256262
}
@@ -274,6 +280,7 @@ fn rich_text_mention_database() {
274280
underline: Some(false),
275281
}),
276282
},
283+
href: Some("https://www.notion.so/baa9d74593254088a992721dc2fa21dd".to_string()),
277284
mention: MentionObject::Database {
278285
database: MentionId {
279286
id: DatabaseId::from_str("baa9d745-9325-4088-a992-721dc2fa21dd").unwrap()

src/models/tests/rich_text_mention_database.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"code": false,
1515
"color": "default"
1616
},
17-
"plain_text": "Shopping lists"
17+
"plain_text": "Shopping lists",
18+
"href": "https://www.notion.so/baa9d74593254088a992721dc2fa21dd"
1819
}

src/models/tests/rich_text_mention_page.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"code": false,
1515
"color": "default"
1616
},
17-
"plain_text": "Shopping List 2023-01-20 "
17+
"plain_text": "Shopping List 2023-01-20 ",
18+
"href": "https://www.notion.so/c81ee77627524e98aa66c37bd4ba9b8d"
1819
}

src/models/text.rs

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ pub enum RichText {
110110
#[serde(flatten)]
111111
rich_text: RichTextCommon,
112112
mention: MentionObject,
113+
href: Option<String>,
113114
},
114115
/// See <https://developers.notion.com/reference/rich-text#equation-objects>
115116
Equation {

0 commit comments

Comments
 (0)