onface/react

自动 markrun-replace

nimoc opened this issue · 1 comments

nimoc commented

放弃手动增加 MR-R

<!--MR-R {
    type: "pre",
    file: './multiple-fixed.demo.js'
} -->
[./multiple-fixed.demo.js](./multiple-fixed.demo.js)

检测到以 .demo.js 结尾的文件自动添加 MR-R

nimoc commented
content = content.replace(/(\[.*?\]\((.*\.demo\.js)\))/gi, function (source, $1, $2) {
                return '<!--MR-R\n{type: "pre",file:"' + $2 + '"}\n-->\n\n' + $1
            })