amis-rpc-design/libs/amis/scripts/code-md-parser.js

12 lines
287 B
JavaScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
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);
};