fix(code): add robust

This commit is contained in:
tzhangchi
2022-09-15 17:26:38 +08:00
parent d2f2080147
commit 52e0e3e794
@@ -36,7 +36,6 @@ export class CodeBlock extends BaseView {
}): Promise<HTML2BlockResult> { }): Promise<HTML2BlockResult> {
// debugger; // debugger;
if (element.tagName === 'CODE') { if (element.tagName === 'CODE') {
debugger;
return [ return [
{ {
type: this.type, type: this.type,
@@ -50,7 +49,9 @@ export class CodeBlock extends BaseView {
}, },
], ],
}, },
lang: element.classList[0].substr(9), lang:
element.classList[0] &&
element.classList[0].substr(9),
}, },
children: [], children: [],
}, },