fix: preserve cjk code block copy text

This commit is contained in:
lucaronin
2026-05-14 07:48:04 +02:00
parent 2fcea0624d
commit 95dab219b8
3 changed files with 41 additions and 2 deletions

View File

@@ -421,7 +421,7 @@ function selectedCodeBlockText(options: {
const range = selectedCodeBlockRange(options)
if (!range) return null
return options.selection?.toString() || range.cloneContents().textContent || ''
return range.cloneContents().textContent || options.selection?.toString() || ''
}
function selectedEditorRange(selection: Selection | null, container: HTMLElement): Range | null {