@@ -174,17 +174,11 @@ export function buildTelegramRichMarkdown(
174174 markdown : string ,
175175 options ?: TelegramRichMessageOptions ,
176176) : TelegramInputRichMessage {
177- const skipEntityDetection = shouldSkipTelegramRichEntityDetection ( markdown , options ) ;
178- return buildTelegramRichHtml (
179- markdownToTelegramRichHtml ( markdown , {
180- ...options ,
181- skipEntityDetection,
182- } ) ,
183- {
184- ...options ,
185- skipEntityDetection,
186- } ,
187- ) ;
177+ const richOptions = {
178+ ...options ,
179+ skipEntityDetection : shouldSkipTelegramRichEntityDetection ( markdown , options ) ,
180+ } ;
181+ return buildTelegramRichHtml ( markdownToTelegramRichHtml ( markdown , richOptions ) , richOptions ) ;
188182}
189183
190184export function buildTelegramRichHtml (
@@ -438,16 +432,14 @@ export function splitTelegramRichMessageTextChunks(params: {
438432 tableMode ?: MarkdownTableMode ;
439433 skipEntityDetection ?: boolean ;
440434} ) : TelegramRichTextChunk [ ] {
441- const skipEntityDetection = shouldSkipTelegramRichEntityDetection ( params . text , {
442- skipEntityDetection : params . skipEntityDetection ,
443- } ) ;
435+ const markdownOptions = {
436+ tableMode : params . tableMode ,
437+ skipEntityDetection : shouldSkipTelegramRichEntityDetection ( params . text , {
438+ skipEntityDetection : params . skipEntityDetection ,
439+ } ) ,
440+ } ;
444441 const renderMarkdownChunk = ( chunk : string ) =>
445- prepareTelegramRichHtml (
446- markdownToTelegramRichHtml ( chunk , {
447- tableMode : params . tableMode ,
448- skipEntityDetection,
449- } ) ,
450- ) ;
442+ prepareTelegramRichHtml ( markdownToTelegramRichHtml ( chunk , markdownOptions ) ) ;
451443 const htmlChunks =
452444 params . textMode === "html"
453445 ? splitPreparedTelegramRichHtml ( {
0 commit comments