feat: option to show markdown preview for super notes (skip e2e) (#2048)

This commit is contained in:
Mo
2022-11-23 11:22:01 -06:00
committed by GitHub
parent 99163d90d2
commit 8579ff39b1
28 changed files with 454 additions and 217 deletions

View File

@@ -0,0 +1,26 @@
export function fallbackCopyTextToClipboard(text: string) {
const textArea = document.createElement('textarea')
textArea.value = text
textArea.style.top = '0'
textArea.style.left = '0'
textArea.style.position = 'fixed'
document.body.appendChild(textArea)
textArea.focus()
textArea.select()
try {
document.execCommand('copy')
} catch (err) {
console.error('Unable to copy', err)
}
document.body.removeChild(textArea)
}
export function copyTextToClipboard(text: string) {
if (!navigator.clipboard) {
fallbackCopyTextToClipboard(text)
return
}
void navigator.clipboard.writeText(text)
}

View File

@@ -0,0 +1,3 @@
export function spaceSeparatedStrings(...strings: string[]): string {
return strings.join(' ')
}