freeCodeCamp/curriculum/test/utils/extract-html-comments.js
Oliver Eyton-Williams 793fa8fb52 test: check replaced iff translatable comment
All translatable comments should be replaced, but nothing else.
2020-10-22 03:18:13 +05:30

13 lines
288 B
JavaScript

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;