mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Fix conversion of npm package and source doc links. [ci skip]
This commit is contained in:
@@ -175,7 +175,11 @@ function build() {
|
|||||||
// Load markdown.
|
// Load markdown.
|
||||||
.readFileSync(readmePath, 'utf8')
|
.readFileSync(readmePath, 'utf8')
|
||||||
// Uncomment docdown HTML hints.
|
// 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, {
|
const $ = cheerio.load(marky(markdown, {
|
||||||
'enableHeadingLinkIcons': false,
|
'enableHeadingLinkIcons': false,
|
||||||
|
|||||||
Reference in New Issue
Block a user