Fix conversion of npm package and source doc links. [ci skip]

This commit is contained in:
John-David Dalton
2016-12-26 10:28:17 -06:00
parent 6672a4f942
commit 30863e5fa6

View File

@@ -175,7 +175,11 @@ function build() {
// Load markdown.
.readFileSync(readmePath, 'utf8')
// Uncomment docdown HTML hints.
.replace(/(<)!--\s*|\s*--(>)/g, '$1$2');
.replace(/(<)!--\s*|\s*--(>)/g, '$1$2')
// Convert source and npm package links to anchors.
.replace(/\[source\]\(([^)]+)\) \[npm package\]\(([^)]+)\)/g, (match, href1, href2) =>
`<p><a href="${ href1 }">source</a> <a href="${ href2 }">npm package</a></p>`
);
const $ = cheerio.load(marky(markdown, {
'enableHeadingLinkIcons': false,