feat:paste image element
This commit is contained in:
@@ -170,6 +170,16 @@ export function getElementListByHTML(htmlText: string): IElement[] {
|
|||||||
value: '\n',
|
value: '\n',
|
||||||
type: ElementType.SEPARATOR,
|
type: ElementType.SEPARATOR,
|
||||||
})
|
})
|
||||||
|
} else if (node.nodeName === 'IMG') {
|
||||||
|
const { src, width, height } = node as HTMLImageElement
|
||||||
|
if (src && width && height) {
|
||||||
|
elementList.push({
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
value: src,
|
||||||
|
type: ElementType.IMAGE
|
||||||
|
})
|
||||||
|
}
|
||||||
} else if (node.nodeName === 'INPUT' && (<HTMLInputElement>node).type === ControlComponent.CHECKBOX) {
|
} else if (node.nodeName === 'INPUT' && (<HTMLInputElement>node).type === ControlComponent.CHECKBOX) {
|
||||||
elementList.push({
|
elementList.push({
|
||||||
type: ElementType.CHECKBOX,
|
type: ElementType.CHECKBOX,
|
||||||
|
|||||||
Reference in New Issue
Block a user