build(docs-infra): Ensures that only member docs are linked (#36316)

This commit ensures that `member` docs are only linked if the linking
text contains `.`.

PR Close #36316
This commit is contained in:
Sonu Kapoor
2020-04-14 07:44:14 -04:00
committed by Matias Niemelä
parent 4fb034aeec
commit aebd5f9af6
2 changed files with 16 additions and 0 deletions

View File

@ -90,6 +90,12 @@ module.exports = function autoLinkCode(getDocFromAlias) {
}
var doc = docs[0];
const isInvalidDoc = doc.docType === 'member' && !keyword.includes('.');
if (isInvalidDoc) {
return false;
}
if (doc.path === '') {
var message = `
autoLinkCode: Doc path is empty for "${doc.id}" - link will not be generated for "${keyword}".