Introduce markdown::Settings

This commit is contained in:
Héctor Ramón Jiménez 2024-07-21 20:00:02 +02:00
parent f830454ffa
commit 65b525af7f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 151 additions and 42 deletions

View file

@ -161,6 +161,15 @@ where
self
}
/// Sets the message handler for link clicks on the [`Rich`] text.
pub fn on_link_maybe(
mut self,
on_link: Option<impl Fn(Link) -> Message + 'a>,
) -> Self {
self.on_link = on_link.map(|on_link| Box::new(on_link) as _);
self
}
/// Sets the default style class of the [`Rich`] text.
#[cfg(feature = "advanced")]
#[must_use]