feat:set content block default width 100%

This commit is contained in:
Hufe921
2022-12-03 14:42:57 +08:00
parent d15ee83e64
commit 37110b675a
3 changed files with 7 additions and 12 deletions
+1 -8
View File
@@ -237,16 +237,9 @@ export function formatElementList(elementList: IElement[], options: IFormatEleme
if (el.value === '\n') {
el.value = ZERO
}
if (el.type === ElementType.IMAGE) {
if (el.type === ElementType.IMAGE || el.type === ElementType.BLOCK) {
el.id = getUUID()
}
if (el.type === ElementType.BLOCK) {
el.id = getUUID()
if (!el.width) {
const { editorOptions: { width, margins } } = options
el.width = width - margins[1] - margins[3]
}
}
if (el.type === ElementType.LATEX) {
const { svg, width, height } = LaTexParticle.convertLaTextToSVG(el.value)
el.width = el.width || width