module Tourmaline::Helpers
Extended Modules
Defined in:
tourmaline/helpers.crConstant Summary
-
DEFAULT_EXTENSIONS =
{audio: "mp3", photo: "jpg", sticker: "webp", video: "mp4", animation: "mp4", video_note: "mp4", voice: "ogg"}
-
HTML_ENTITY_MAP =
{"bold" => {"<b>", "</b>"}, "italic" => {"<i>", "</i>"}, "underline" => {"<u>", "</u>"}, "code" => {"<code>", "</code>"}, "pre" => {"<pre>\n", "\n</pre>"}, "pre_language" => {"<pre><code class=\"language-{language}\">\n", "\n</code></pre>"}, "strikethrough" => {"<s>", "</s>"}, "text_mention" => {"<a href=\"tg://user?id={id}\">", "</a>"}, "text_link" => {"<a href=\"{url}\">", "</a>"}, "spoiler" => {"<span class=\"tg-spoiler\">", "</span>"}}
-
MD_ENTITY_MAP =
{"bold" => {"*", "*"}, "italic" => {"_", "_"}, "underline" => {"", ""}, "code" => {"`", "`"}, "pre" => {"```\n", "\n```"}, "pre_language" => {"```{language}\n", "\n```"}, "strikethrough" => {"", ""}, "text_mention" => {"[", "](tg://user?id={id})"}, "text_link" => {"[", "]({url})"}}
-
MDV2_ENTITY_MAP =
{"bold" => {"*", "*"}, "italic" => {"_", "_"}, "underline" => {"__", "__"}, "code" => {"`", "`"}, "pre" => {"```\n", "\n```"}, "pre_language" => {"```{language}\n", "\n```"}, "strikethrough" => {"~", "~"}, "text_mention" => {"[", "](tg://user?id={id})"}, "text_link" => {"[", "]({url})"}, "spoiler" => {"||", "||"}}
Instance Method Summary
- #escape_html(text)
- #escape_md(text, version = 1)
- #pad_utf16(text)
- #random_string(length)
- #unpad_utf16(text)
- #unparse_html(text : String, entities ents : Array(MessageEntity))
- #unparse_text(text : String, entities ents : Array(MessageEntity), parse_mode : ParseMode = :markdown, escape : Bool = false)
Instance Method Detail
def unparse_text(text : String, entities ents : Array(MessageEntity), parse_mode : ParseMode = :markdown, escape : Bool = false)
#