Update index.ts

This commit is contained in:
yanmao 2022-01-12 18:58:17 +08:00
parent fc1f1f5903
commit 10c9a7f3cb
1 changed files with 1 additions and 1 deletions

View File

@ -700,7 +700,7 @@ class NodeModel implements NodeModelInterface {
} else node.attributes(key, attrs[key].toString());
});
if (typeof style === 'number') style = {};
if (typeof style === 'string') style = getStyleMap(style);
else if (typeof style === 'string') style = getStyleMap(style);
style = style || {};
const keys = Object.keys(style);
keys.forEach((key) => {