Browse Source
Merge pull request #196 from wangeditor-team/fix-video-err
fix: fix视频插入iframe时报错的问题
fix-react18
王福朋
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
1 deletions
-
packages/video-module/src/module/menu/InsertVideoMenu.ts
|
|
@ -127,10 +127,14 @@ class InsertVideoMenu implements IModalMenu { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (src.trim().indexOf('<iframe') !== 0) { |
|
|
|
src = replaceSymbols(src) |
|
|
|
} |
|
|
|
|
|
|
|
// 新建一个 video node
|
|
|
|
const video: VideoElement = { |
|
|
|
type: 'video', |
|
|
|
src: replaceSymbols(src), |
|
|
|
src, |
|
|
|
children: [{ text: '' }], // 【注意】void node 需要一个空 text 作为 children
|
|
|
|
} |
|
|
|
|
|
|
|