@@ -84,7 +84,9 @@ export const DrawioViewer = React.memo((props: DrawioViewerProps): JSX.Element =
}
const code = children instanceof Array
- ? children.map(e => e?.toString()).join('')
+ ? children
+ .filter(elem => (typeof elem === 'string')) // omit non-string elements (e.g. br element generated by line-breaks option)
+ .join('')
: children.toString();
let mxgraphData;