feat:增加图片插入
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
import { ElementType, IElement } from ".."
|
||||
import { ZERO } from "../dataset/constant/Common"
|
||||
|
||||
export function writeText(text: string) {
|
||||
if (!text) return
|
||||
window.navigator.clipboard.writeText(text.replaceAll(ZERO, `\n`))
|
||||
}
|
||||
|
||||
export function writeTextByElementList(elementList: IElement[]) {
|
||||
const text = elementList
|
||||
.map(p => !p.type || p.type === ElementType.TEXT ? p.value : '')
|
||||
.join('')
|
||||
writeText(text)
|
||||
}
|
||||
Reference in New Issue
Block a user