feat:add codeblock

This commit is contained in:
黄云飞
2022-02-18 15:47:06 +08:00
parent 76637eb863
commit 28c818a8fb
12 changed files with 214 additions and 13 deletions
+2 -2
View File
@@ -3,8 +3,8 @@ import { ElementType, IElement } from ".."
import { ZERO } from "../dataset/constant/Common"
import { EDITOR_ELEMENT_ZIP_ATTR } from "../dataset/constant/Element"
export function formatElementList(elementList: IElement[]) {
if (elementList[0]?.value !== ZERO) {
export function formatElementList(elementList: IElement[], isHandleFirstElement = true) {
if (isHandleFirstElement && elementList[0]?.value !== ZERO) {
elementList.unshift({
value: ZERO
})