build(docs-infra): add `_` to ignored ignoreGenericWords (#36316)
Previously, when a document included `_`, the autoLinker will try to generate a link, e.g from `core/ɵComponentDef._`. This commit adds it to the ignored words to prevent that. PR Close #36316
This commit is contained in:
parent
aebd5f9af6
commit
e5f9e3d018
|
@ -5,6 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = function ignoreGenericWords() {
|
module.exports = function ignoreGenericWords() {
|
||||||
const ignoredWords = new Set(['a', 'classes', 'create', 'error', 'group', 'request', 'target', 'value']);
|
const ignoredWords = new Set(['a', 'classes', 'create', 'error', 'group', 'request', 'target', 'value', '_']);
|
||||||
return (docs, words, index) => ignoredWords.has(words[index].toLowerCase()) ? [] : docs;
|
return (docs, words, index) => ignoredWords.has(words[index].toLowerCase()) ? [] : docs;
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,6 +16,12 @@ describe('ignoreGenericWords', () => {
|
||||||
expect(ignoreGenericWords(docs, words, 1)).toEqual([]);
|
expect(ignoreGenericWords(docs, words, 1)).toEqual([]);
|
||||||
expect(ignoreGenericWords(docs, words, 2)).toEqual(docs);
|
expect(ignoreGenericWords(docs, words, 2)).toEqual(docs);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should ignore `_` in all docs', () => {
|
||||||
|
const docs = [{docType: 'package', name: 'create'}, {docType: 'class', name: 'Foo'}];
|
||||||
|
const words = ['_'];
|
||||||
|
expect(ignoreGenericWords(docs, words, 0)).toEqual([]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue