how to hyperlink a word in readme code example
Example: how to automatically create hyperlink in readme
LinkHeadingToContent(headingText) {
headingList = headingText.split('\n');
headingList.map((heading, index) => {
const firstDigitIndex = heading.search(/\d/);
const anchorText = heading
.toLowerCase()
.replace(/[^a-z\d\s]/g, '')
.trim()
.replace(/ /g, '-');
headingList[index] =
[heading.slice(0, firstDigitIndex), '[', heading.slice(firstDigitIndex)].join('') +
'](#' +
anchorText +
')';
});
return headingList.join('\n');
}