freeCodeCamp/curriculum/test/utils/extract-html-comments.js

13 lines
288 B
JavaScript
Raw Normal View History

var rehype = require('rehype');
var vfile = require('vfile');
var getComments = require('./plugins/get-html-comments');
const processor = rehype().use(getComments);
function extractComments(html) {
return processor.processSync(vfile(html)).data;
}
module.exports = extractComments;