fix: move mark code to post-process-html step

This commit is contained in:
Zhicheng WANG 2019-01-01 16:14:18 +08:00
parent b64124f0c8
commit 0cb8d723ac
4 changed files with 3 additions and 4 deletions

View File

@ -1,4 +1,5 @@
const rehype = require('rehype');
const {mark} = require('./translator');
/**
* @dgProcessor postProcessHtml
@ -35,7 +36,7 @@ module.exports = function postProcessHtml(log, createDocMessage) {
.forEach(doc => {
try {
vFile = engine.processSync(doc.renderedContent);
doc.renderedContent = vFile.contents;
doc.renderedContent = mark(vFile.contents);
vFile.messages.forEach(m => {
log.warn(createDocMessage(m.message, doc));
});

View File

@ -3,8 +3,6 @@ const html = require('remark-html');
const code = require('./handlers/code');
const mapHeadings = require('./plugins/mapHeadings');
const {mark} = require('./translator');
/**
* @dgService renderMarkdown
* @description
@ -26,7 +24,7 @@ module.exports = function renderMarkdown() {
.use(mapHeadings(headingMap))
.use(html, { handlers: { code } });
return mark(renderer.processSync(content).toString());
return renderer.processSync(content).toString();
};
/**