docs: add target blank for all links (#5073)

This commit is contained in:
neverland
2019-11-21 17:58:01 +08:00
committed by GitHub
parent 3bcb4e7716
commit 4e5bc170e1
7 changed files with 177 additions and 120 deletions

View File

@@ -3,6 +3,7 @@ const MarkdownIt = require('markdown-it');
const markdownItAnchor = require('markdown-it-anchor');
const frontMatter = require('front-matter');
const highlight = require('./highlight');
const linkOpen = require('./link-open');
const cardWrapper = require('./card-wrapper');
const { slugify } = require('transliteration');
@@ -58,6 +59,7 @@ module.exports = function(source) {
options = {
wrapper,
linkOpen: true,
...options
};
@@ -68,5 +70,9 @@ module.exports = function(source) {
source = fm.body;
}
if (options.linkOpen) {
linkOpen(parser);
}
return options.wrapper(parser.render(source), fm);
};