Skip to content

Commit

Permalink
fix: error tab comment (#1737)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenkristian authored Feb 28, 2023
1 parent ad4dbcb commit 318562b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/helpers/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ export const htmlToJson = (html: any) => {
}
});
} else {
if (html.type === 'figure') {
if (html.props.children.type === 'img') {
if (html?.type === 'figure') {
if (html?.props?.children.type === 'img') {
const imgs = html.props.children.props.src;
img.push(imgs);
}
} else {
if (Array.isArray(html.props.children)) {
if (Array.isArray(html?.props?.children)) {
html.props.children.map(child => {
if (child.type === 'img') {
const imgs = child.props.src;
Expand All @@ -136,13 +136,13 @@ export const htmlToJson = (html: any) => {
}
});
} else {
if (html.type === 'img') {
const imgs = html.props.children.src;
if (html?.type === 'img') {
const imgs = html?.props?.children?.src;
img.push(imgs);
} else {
if (typeof html.props.children === 'string')
if (typeof html?.props?.children === 'string')
text += html.props.children;
else text += html.props.children.props.children;
else text += html?.props?.children?.props?.children;
}
}
}
Expand Down

0 comments on commit 318562b

Please sign in to comment.