소스 검색

图片地址替换传值判断

wangziqian 4 년 전
부모
커밋
9c0e193d0f
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/utils/handleTinymce.js

+ 1 - 0
src/utils/handleTinymce.js

@@ -1,6 +1,7 @@
 import axios from 'axios'
 const _ = require('lodash')
 export async function getContainImgHTMLNode(node) { // 获取包含图片的html文本
+  if (node === null || node === undefined) return node
   const nowHandleText = _.cloneDeep(node)
   const reg = /<img.*?(?:>|\/>)/gi // 获取<img />的正则
   const imgArr = node.match(reg) // 获取图片数组