fix: [code-1743]: fix bug in updating description (#1204)

gitness-test1
Calvin Lee 2024-04-11 00:23:39 +00:00 committed by Harness
parent d6de34b936
commit 622cc58b21
1 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@
import { useHistory } from 'react-router-dom'
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Container } from '@harnessio/uicore'
import { isEmpty } from 'lodash-es'
import cx from 'classnames'
import MarkdownPreview from '@uiw/react-markdown-preview'
import rehypeVideo from 'rehype-video'
@ -57,7 +58,7 @@ export function MarkdownViewer({
event => {
const imgTags = ref?.current?.querySelector('.wmde-markdown')?.querySelectorAll('img')
const { target } = event
if (imgTags) {
if (imgTags && !isEmpty(imgTags)) {
const imageArray = Array.from(imgTags)
const imageStringArray = imageArray.filter(object => object.src && !object.className).map(img => img.src)
setImageEvent(imageStringArray)