aboutsummaryrefslogtreecommitdiff
path: root/src/models/text.rs
diff options
context:
space:
mode:
authorGravatar Jake Swenson <jakeswenson@users.noreply.github.com> 2021-05-23 10:31:38 -0700
committerGravatar GitHub <noreply@github.com> 2021-05-23 10:31:38 -0700
commit9d5b84b88ddc2b7de1bc0f03d9026eb52e8976ac (patch)
tree735b1031148d4cddfa1a0e01f52b02e23e94f9cb /src/models/text.rs
parent4cffa16633f83b6604f7ce3de47d40a29e6a9b54 (diff)
downloadnotion-9d5b84b88ddc2b7de1bc0f03d9026eb52e8976ac.tar.gz
notion-9d5b84b88ddc2b7de1bc0f03d9026eb52e8976ac.tar.zst
notion-9d5b84b88ddc2b7de1bc0f03d9026eb52e8976ac.zip
Add initial todo example (#13)
Diffstat (limited to 'src/models/text.rs')
-rw-r--r--src/models/text.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/models/text.rs b/src/models/text.rs
index a10007d..f7ea2b6 100644
--- a/src/models/text.rs
+++ b/src/models/text.rs
@@ -81,3 +81,14 @@ pub enum RichText {
rich_text: RichTextCommon,
},
}
+
+impl RichText {
+ pub fn plain_text(&self) -> &str {
+ use RichText::*;
+ match self {
+ Text { rich_text, .. } | Mention { rich_text, .. } | Equation { rich_text, .. } => {
+ &rich_text.plain_text
+ }
+ }
+ }
+}