|
@@ -1,7 +1,7 @@
|
|
|
/*
|
|
|
- * @Author: your name
|
|
|
+ * @Author: 你好
|
|
|
* @Date: 2021-08-24 11:48:53
|
|
|
- * @LastEditTime: 2021-08-24 14:17:57
|
|
|
+ * @LastEditTime: 2021-08-25 11:22:37
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: \md-\test\markdownParseImage.js
|
|
@@ -10,12 +10,12 @@ let imageReg = /^\!\[\S+\]\(\S+\)/mg
|
|
|
let testMdText = `
|
|
|
# docsify使用图片
|
|
|

|
|
|
-
|
|
|

|
|
|
+
|
|
|
`
|
|
|
-let dom = testMdText.match(imageReg).reduce((acc,current)=>{
|
|
|
- return acc += current.replace(/^\!\[/,`<img src="`)
|
|
|
- .replace(/\]\(/,`" title="`)
|
|
|
- .replace(/\)/,`"></img>\n`)
|
|
|
-},'')
|
|
|
+let dom = testMdText.match(imageReg).reduce((acc, current) => {
|
|
|
+return acc += current.replace(/^\!\[/, `<img src="`)
|
|
|
+.replace(/\]\(/, `" title="`)
|
|
|
+ .replace(/\)/, `"></img>\n`)
|
|
|
+}, '')
|
|
|
console.log(dom)
|