From 807d18cefce8ec19c5836fb55ee8dae125777d16 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 19 Oct 2022 13:14:16 +0300 Subject: [PATCH] Improve documentation. --- td/generate/scheme/td_api.tl | 6 +++--- td/telegram/MessageEntity.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 7ecf007ed..efd4c04e4 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -66,7 +66,7 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; @@ -5253,10 +5253,10 @@ getMessageAddedReactions chat_id:int53 message_id:int53 reaction_type:ReactionTy setDefaultReactionType reaction_type:ReactionType = Ok; -//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously @text The text in which to look for entites +//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entites getTextEntities text:string = TextEntities; -//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode +//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously diff --git a/td/telegram/MessageEntity.cpp b/td/telegram/MessageEntity.cpp index ec2b18d36..87cf8811f 100644 --- a/td/telegram/MessageEntity.cpp +++ b/td/telegram/MessageEntity.cpp @@ -1563,12 +1563,12 @@ static bool are_entities_valid(const vector &entities) { } // parents are not pre after this point if (is_pre_entity(entity.type) && (nested_entity_type_mask & ~get_blockquote_entities_mask()) != 0) { - // Pre and Code can't be contained in other entities, except blockquote + // Pre and Code can't be part of other entities, except blockquote return false; } if ((is_continuous_entity(entity.type) || is_blockquote_entity(entity.type)) && (nested_entity_type_mask & get_continuous_entities_mask()) != 0) { - // continuous and blockquote can't be contained in continuous + // continuous and blockquote can't be part of other continuous entity return false; } if ((nested_entity_type_mask & get_splittable_entities_mask()) != 0) {