mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-24 01:15:24 +08:00
fix(lark): preserve incoming rich-text code blocks (#2626)
This commit is contained in:
@@ -184,7 +184,7 @@ class LarkMessageConverter(abstract_platform_adapter.AbstractMessageConverter):
|
||||
normalized = LarkMessageConverter._normalize_inbound_content(message, message_content)
|
||||
for ele in normalized:
|
||||
tag = ele.get('tag')
|
||||
if tag in {'text', 'md'}:
|
||||
if tag in {'text', 'md', 'code_block'}:
|
||||
text = ele.get('text') or ''
|
||||
if text:
|
||||
components.append(platform_message.Plain(text=text))
|
||||
|
||||
@@ -726,7 +726,7 @@ class LarkMessageConverter(abstract_platform_adapter.AbstractMessageConverter):
|
||||
]
|
||||
|
||||
for ele in message_content['content']:
|
||||
if ele['tag'] == 'text':
|
||||
if ele['tag'] in {'text', 'code_block'}:
|
||||
lb_msg_list.append(platform_message.Plain(text=ele['text']))
|
||||
elif ele['tag'] == 'at':
|
||||
lb_msg_list.append(platform_message.At(target=ele['user_name']))
|
||||
|
||||
Reference in New Issue
Block a user