mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
12 lines
287 B
JavaScript
12 lines
287 B
JavaScript
|
const parserMarkdown = require('./md-parser');
|
||
|
|
||
|
module.exports = function (content, file) {
|
||
|
const markdowns = [];
|
||
|
|
||
|
content.replace(/\/\*\!markdown\n([\s\S]+?)\*\//g, function (_, md) {
|
||
|
markdowns.push(md.trim());
|
||
|
});
|
||
|
|
||
|
return parserMarkdown(markdowns.join('\n\n'), file);
|
||
|
};
|