diff --git a/crates/teloxide/src/utils/render.rs b/crates/teloxide/src/utils/render.rs index a609b233..f1ea6baa 100644 --- a/crates/teloxide/src/utils/render.rs +++ b/crates/teloxide/src/utils/render.rs @@ -140,7 +140,7 @@ impl<'a> Renderer<'a> { self.format(&html::HTML) } - /// Renders and returns the text as a **Markdown-formatted** string. + /// Renders and returns the text as a **MarkdownV2-formatted** string. #[must_use] #[inline] pub fn as_markdown(&self) -> String { @@ -164,7 +164,7 @@ mod test { let render = Renderer::new(text, &entities); assert_eq!(render.as_html(), "Bold italic <underline_"); - assert_eq!(render.as_markdown(), "**Bold** _\ritalic_\r __\rbold both italics"); - assert_eq!(render.as_markdown(), "Some **bold _\rboth** italics_\r"); + assert_eq!(render.as_markdown(), "Some *bold _\rboth* italics_\r"); } #[test] @@ -243,8 +243,8 @@ mod test { ); assert_eq!( render.as_markdown(), - "**Hi** _\rhow_\r __\rare__\r ~you~?\n**n****__\r~este~__\rd** [entities](https://t.me/) \ - [are](tg://user?id=1234567) `cool`\n>Im in a Blockquote\\!" + "*Hi* _\rhow_\r __\rare__\r ~you~?\n*n**__\r~este~__\rd* [entities](https://t.me/) \ + [are](tg://user?id=1234567) `cool`\n>Im in a Blockquote\\!" ); } } diff --git a/crates/teloxide/src/utils/render/markdown.rs b/crates/teloxide/src/utils/render/markdown.rs index 822274fb..4a046ce9 100644 --- a/crates/teloxide/src/utils/render/markdown.rs +++ b/crates/teloxide/src/utils/render/markdown.rs @@ -5,7 +5,7 @@ use crate::utils::markdown::ESCAPE_CHARS; use super::{ComplexTag, Kind, Place, SimpleTag, Tag, TagWriter}; pub static MARKDOWN: TagWriter = TagWriter { - bold: SimpleTag::new("**", "**"), + bold: SimpleTag::new("*", "*"), blockquote: SimpleTag::new(">", ""), italic: SimpleTag::new("_\r", "_\r"), underline: SimpleTag::new("__\r", "__\r"),