diff --git a/aio/tools/transforms/angular-base-package/post-processors/auto-link-code.js b/aio/tools/transforms/angular-base-package/post-processors/auto-link-code.js index fae9ba475e..92f5cf06ee 100644 --- a/aio/tools/transforms/angular-base-package/post-processors/auto-link-code.js +++ b/aio/tools/transforms/angular-base-package/post-processors/auto-link-code.js @@ -65,7 +65,9 @@ module.exports = function autoLinkCode(getDocFromAlias) { }; } function foundValidDoc(docs) { - return docs.length === 1 && autoLinkCodeImpl.docTypes.indexOf(docs[0].docType) !== -1; + return docs.length === 1 && + !docs[0].internal && + autoLinkCodeImpl.docTypes.indexOf(docs[0].docType) !== -1; } function createLinkNode(doc, text) { diff --git a/aio/tools/transforms/angular-base-package/post-processors/auto-link-code.spec.js b/aio/tools/transforms/angular-base-package/post-processors/auto-link-code.spec.js index f300487aed..c5fabf43d3 100644 --- a/aio/tools/transforms/angular-base-package/post-processors/auto-link-code.spec.js +++ b/aio/tools/transforms/angular-base-package/post-processors/auto-link-code.spec.js @@ -79,6 +79,13 @@ describe('autoLinkCode post-processor', () => { ''); }); + it('should ignore code items that match an internal API doc', () => { + aliasMap.addDoc({ docType: 'class', id: 'MyClass', aliases: ['MyClass'], path: 'a/b/myclass', internal: true }); + const doc = { docType: 'test-doc', renderedContent: 'MyClass' }; + processor.$process([doc]); + expect(doc.renderedContent).toEqual('MyClass'); + }); + it('should insert anchors for individual text nodes within a code block', () => { aliasMap.addDoc({ docType: 'class', id: 'MyClass', aliases: ['MyClass'], path: 'a/b/myclass' }); const doc = { docType: 'test-doc', renderedContent: 'MyClassMyClass' };