You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pasting plain text (e.g., code snippets) into Affine, the content remains in a standard Text Block instead of automatically converting to a Code Block format. This requires manual reformatting, reducing efficiency.
Steps to Reproduce
Copy a code snippet (e.g., console.log("Hello")).
Paste it into an Affine Text Block.
Actual Result: The text retains default formatting (not a Code Block).
Expected Result: Auto-detection as a Code Block (or an option to convert easily).
Original Format:
After Copy to Affine:
Use case
Proposed Solutions
Auto-Detection: Detect code-like patterns (indentation, symbols like {}()) and prompt to convert to Code Block.
Shortcut Support: Add Ctrl/Cmd + Shift + C to convert selected Text Blocks to Code Blocks.
Right-Click Menu: Add a "Paste as Code" option during pasting.
Anything else?
No response
Are you willing to submit a PR?
Yes I'd like to help by submitting a PR!
The text was updated successfully, but these errors were encountered:
Try the newer version 0.21.3, seems the issue got fixed.
However the property of the code block is not correct. The original code block(python) was converted to plane text after paste to AFFiNE.
Description
Description
When pasting plain text (e.g., code snippets) into Affine, the content remains in a standard Text Block instead of automatically converting to a Code Block format. This requires manual reformatting, reducing efficiency.
Steps to Reproduce
console.log("Hello")
).Original Format:

After Copy to Affine:

Use case
Proposed Solutions
{}()
) and prompt to convert to Code Block.Ctrl/Cmd + Shift + C
to convert selected Text Blocks to Code Blocks.Anything else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: