mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
fix(editor): markdown code preprocessor should handle link correctly (#11671)
Close [BS-3117](https://linear.app/affine-design/issue/BS-3117/代码粘贴后出现多余的-和-符号)
This commit is contained in:
@@ -375,4 +375,26 @@ test.describe('paste to code block', () => {
|
||||
// Verify the pasted code maintains indentation
|
||||
await verifyCodeBlockContent(page, 0, textWithHtmlTags);
|
||||
});
|
||||
|
||||
test('should not wrap line in brackets when pasting code', async ({
|
||||
page,
|
||||
}) => {
|
||||
await pressEnter(page);
|
||||
await addCodeBlock(page);
|
||||
const plainTextCode = [
|
||||
' model: anthropic("claude-3-7-sonnet-20250219"),',
|
||||
' prompt: How many people will live in the world in 2040?',
|
||||
' providerOptions: {',
|
||||
' anthropic: {',
|
||||
' thinking: { type: enabled, budgetTokens: 12000 },',
|
||||
' } satisfies AnthropicProviderOptions,',
|
||||
' },',
|
||||
].join('\n');
|
||||
|
||||
await pasteContent(page, { 'text/plain': plainTextCode });
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
// Verify the pasted code maintains indentation
|
||||
await verifyCodeBlockContent(page, 0, plainTextCode);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user