editor: improve code block detection when pasting from vscode

This commit is contained in:
Abdullah Atta
2023-08-26 18:02:48 +05:00
committed by Abdullah Atta
parent 8b056fe610
commit 8299ea909e

View File

@@ -787,8 +787,8 @@ function detectCodeBlock(dataTransfer: DataTransfer) {
const isVSCode = const isVSCode =
vscode || vscode ||
(document.body.firstElementChild instanceof HTMLDivElement && (document.body.firstElementChild instanceof HTMLDivElement &&
document.body.firstElementChild.style.fontFamily === document.body.firstElementChild.style.fontFamily.includes("monospace") &&
`'Droid Sans Mono', 'monospace', monospace`); document.body.firstElementChild.style.whiteSpace.includes("pre"));
const language = const language =
vscodeData?.mode || vscodeData?.mode ||