I. Intro
You can use the code block message function in chats.
II. Steps
Open code block
There are four ways to open code block in chats and topic groups:
Method 1: Select text in the message input box and a toolbar will appear. Click the Code block icon.
250px|700px|reset
Method 2: Click the Expand icon in the message input box, and then click the Code block icon above it.
250px|700px|reset
250px|700px|reset
Method 3: Use the shortcut Ctrl + Alt + C (Windows) or ⌘ + Option + C (Mac).
Method 4: Enter the markdown syntax ``` + space or ``` + [code language] + space.
Edit and send code block messages
Switch code language and send code block messages
Lark defaults to plain text language when sending a code block for the first time. Click the Downward arrow icon in the upper-left corner of the code block to select the code language you want to use.
Lark stores the last code language used and defaults to that language the next time you open a code block.
250px|700px|reset
Click the Send icon in the lower-right corner or press Enter.
250px|700px|reset
Wrap code blocks
Wrapping is turned on by default when editing a code block. The content of a line of code that is too long will be automatically wrapped and displayed.
You can cancel wrapping by clicking No Wrap in the upper-right corner of the code block. The long code will then not be wrapped and a horizontal scroll bar will appear in the box.
You can click Wrap to switch back to wrap mode.
250px|700px|reset
250px|700px|reset
Copy code blocks
Click Copy in the upper-right corner of the code block.
250px|700px|reset
View code block messages
When you receive a code block message, if the sender selected Wrap, the code block will automatically be wrapped. If the sender turned off Wrap, you will have to drag the horizontal scroll bar to see the full code.
250px|700px|reset
When you receive a long piece of code, you can click Show More to see it all.
250px|700px|reset
III. FAQs