Эх сурвалжийг харах

图片地址替换传值判断

wangziqian 4 жил өмнө
parent
commit
9c0e193d0f

+ 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) // 获取图片数组