Created
October 15, 2021 00:18
-
-
Save brecert/40397874f308a8c2e80a737d430facc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bitflag TextFormatting: u8 { | |
BOLD, | |
ITLALIC, | |
MONOSPACE, | |
UNDERLINE, | |
STRIKETHROUGH, | |
SPOILER | |
} | |
enum TextEntity { | |
Text | |
Emoji | |
Code { syn: TextSpan } | |
Link { uri: TextSpan } | |
} | |
struct TextEntity { | |
type: TextEntity | |
text: TextSpan | |
full_span: TextSpan | |
formatting: TextFormatting | |
entities: Vec<TextEntity> | |
} | |
enum MessageEntity { | |
Text { entities: Vec<TextEntity> }, | |
Expr { type: TextSpan, expr: TextSpan, full_span: TextSpan }, | |
Image { uri: TextSpan, alt: Option<TextSpan> }, | |
Blockquote { entities: Vec<TextEntity> } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment