diff --git a/packages/video-module/__tests__/parse-html.test.ts b/packages/video-module/__tests__/parse-html.test.ts index cda5840e1..b76b0f67a 100644 --- a/packages/video-module/__tests__/parse-html.test.ts +++ b/packages/video-module/__tests__/parse-html.test.ts @@ -76,6 +76,7 @@ describe('video - parse html', () => { width: '500', height: '300', style: {}, + textAlign: 'center', children: [{ text: '' }], // void 元素有一个空 text }) }) @@ -99,6 +100,7 @@ describe('video - parse html', () => { width: 'auto', height: 'auto', style: {}, + textAlign: 'center', children: [{ text: '' }], // void 元素有一个空 text }) }) diff --git a/packages/video-module/src/module/parse-elem-html.ts b/packages/video-module/src/module/parse-elem-html.ts index 3ffe9fc00..2392dd486 100644 --- a/packages/video-module/src/module/parse-elem-html.ts +++ b/packages/video-module/src/module/parse-elem-html.ts @@ -16,6 +16,7 @@ function genVideoElem( width = 'auto', height = 'auto', style: videoStyle = {}, + textAlign = 'center', ): VideoElement { return { type: 'video', @@ -25,6 +26,7 @@ function genVideoElem( height, style, children: [{ text: '' }], // void 元素有一个空 text + textAlign, } } @@ -35,7 +37,7 @@ function parseHtml(elem: DOMElement, _children: Descendant[], _editor: IDomEdito let width = 'auto' let height = 'auto' let style = {} - + let textAlign = 'center' //