fix(docs-infra): stop auto-linking "state" and "group" to APIs

Prevents common words used in code examples from being incorrectly
linked to API references.

Fixes: #66292
This commit is contained in:
Shuaib Hasan Akib
2026-01-04 22:18:52 +06:00
committed by Kirill Cherkashin
parent 5d3708e5ed
commit 8358e548ce
3 changed files with 13 additions and 0 deletions
@@ -18,6 +18,8 @@ const LINK_EXEMPT = new Set([
'readonly',
'disabled',
'hidden',
'state',
'group',
]);
export function shouldLinkSymbol(symbol: string): boolean {
@@ -6,3 +6,9 @@ this is code
<docs-code path="./example-with-region.ts" />
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="./messages.fr.xlf" />
<docs-code header="Property names should not be linked" language="ts">
const form = {
state: ['']
};
</docs-code>
@@ -47,4 +47,9 @@ describe('markdown to html', () => {
const codeBlock = markdownDocument.querySelectorAll('code')[3];
expect(codeBlock).toBeTruthy();
});
it('should not link property names in object literals', () => {
const codeBlock = markdownDocument.querySelectorAll('code')[4];
expect(codeBlock?.innerHTML).not.toContain('<a href="/api/animations/state">state</a>');
});
});