mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-21 22:15:13 +01:00
Adjust wording
This commit is contained in:
parent
fa08605c02
commit
e91db758c8
3 changed files with 13 additions and 17 deletions
|
@ -561,4 +561,5 @@ This release was yanked because it accidentally [breaks backwards compatibility]
|
|||
## 0.1.0 - 2020-02-19
|
||||
|
||||
### Added
|
||||
- This project.
|
||||
|
||||
- This project.
|
||||
|
|
|
@ -5,8 +5,8 @@ use teloxide_core::types::Message;
|
|||
|
||||
use super::Render;
|
||||
|
||||
/// The [`RenderMessageTextHelper`] trait provides methods to generate HTML and
|
||||
/// Markdown representations of the text and captions in a Telegram message.
|
||||
/// Generates HTML and Markdown representations of text and captions in a
|
||||
/// Telegram message.
|
||||
pub trait RenderMessageTextHelper {
|
||||
/// Returns the HTML representation of the message text, if the message
|
||||
/// contains text. This method will parse the text and any entities
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! Utilities for rendering texts and message entities to HTML and Markdown.
|
||||
//! Utils for rendering HTML and Markdown output.
|
||||
|
||||
use teloxide_core::types::{MessageEntity, MessageEntityKind as MEK};
|
||||
|
||||
|
@ -11,8 +11,7 @@ mod html;
|
|||
mod markdown;
|
||||
mod tag;
|
||||
|
||||
/// The [`Render`] struct is responsible for parsing the text and entities to
|
||||
/// produce the final formatted output.
|
||||
/// Parses text and message entities to produce the final formatted output.
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
pub struct Render<'a> {
|
||||
text: &'a str,
|
||||
|
@ -20,11 +19,7 @@ pub struct Render<'a> {
|
|||
}
|
||||
|
||||
impl<'a> Render<'a> {
|
||||
/// Creates a new `Render` instance with the given text and entities.
|
||||
///
|
||||
/// The `Render` is responsible for parsing the text and entities to
|
||||
/// produce the final formatted output. This constructor sets up the
|
||||
/// initial state needed for the parsing process.
|
||||
/// Creates a new [`Render`] instance with given text and message entities.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
|
@ -84,11 +79,11 @@ impl<'a> Render<'a> {
|
|||
Self { text, tags }
|
||||
}
|
||||
|
||||
/// Renders the text with the given [`TagWriter`].
|
||||
/// Renders text with a given [`TagWriter`].
|
||||
///
|
||||
/// This method iterates through the text and the associated position tags,
|
||||
/// and writes the text with the appropriate tags to a buffer. The
|
||||
/// resulting buffer is then returned as a `String`.
|
||||
/// This method iterates through the text and the associated position tags
|
||||
/// and writes the text with the appropriate tags to a buffer, which is then
|
||||
/// returned as a `String`.
|
||||
///
|
||||
/// If input have no tags we just return the original text as-is.
|
||||
#[must_use]
|
||||
|
@ -137,14 +132,14 @@ impl<'a> Render<'a> {
|
|||
buffer
|
||||
}
|
||||
|
||||
/// Render and return the text as an **HTML-formatted** string.
|
||||
/// Renders and returns the text as an **HTML-formatted** string.
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub fn as_html(&self) -> String {
|
||||
self.format(&html::HTML)
|
||||
}
|
||||
|
||||
/// Render and return the text as a **Markdown-formatted** string.
|
||||
/// Renders and returns the text as a **Markdown-formatted** string.
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub fn as_markdown(&self) -> String {
|
||||
|
|
Loading…
Reference in a new issue