-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(util): add markdown format functions to util #2314
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missing spoilers and code blocks (perhaps even more that I didn't think of).
Do you think we need to add the H1, H2, H3, ... formatting? |
yes, i think this should support all of discord's supported markdown, including named links and timestamps |
Promptly added. |
fn strikethrough(self) -> Self; | ||
} | ||
|
||
impl Format for String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer formatters like twilight_mention::fmt::MentionFormat
and twilight_model::user::DiscriminatorDisplay
over extension methods.
@@ -15,6 +15,9 @@ | |||
#[cfg(feature = "builder")] | |||
pub mod builder; | |||
|
|||
#[cfg(feature = "format")] | |||
pub mod format; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub mod format; | |
pub mod fmt; |
Closes #2279.
This draft PR explores a potential implementation for markdown formatting functions. It is expected that the implementation would be iterated on for a bit before this is actually merged into main.