fix(docs-infra): prevent automatic linking of 'json' (#44294)

add 'json' to the ignoreGenericWords set so that it doesn't get
wrongly linked to the jsonPipe during the aio docs generation
as it is a generic javarscript term

PR Close #44294
This commit is contained in:
dario-piotrowicz
2021-11-27 22:23:31 +00:00
committed by Dylan Hunn
parent 257a30d7b3
commit 078940150e
3 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -843,7 +843,7 @@ For more information on pipes, see [Pipes](guide/pipes).
<code-example hideCopy path="ajs-quick-reference/src/app/app.component.html" region="json"></code-example>
The Angular `json` pipe does the same thing.
The Angular [`json`](api/common/JsonPipe) pipe does the same thing.
</td>
</tr>
+1 -1
View File
@@ -220,7 +220,7 @@ Any unique value will do, but using a descriptive name is helpful.
2. You can now remove the diagnostic messages that show interpolated values.
3. To confirm that two-way data binding works for the entire hero model, add a new text binding with the [`json` pipe](api/common/JsonPipe) (which would serialize the data to a string) at the top to the component's template.
3. To confirm that two-way data binding works for the entire hero model, add a new text binding with the [`json`](api/common/JsonPipe) pipe (which would serialize the data to a string) at the top to the component's template.
After these revisions, the form template should look like the following:
@@ -5,6 +5,19 @@
*/
module.exports = function ignoreGenericWords() {
const ignoredWords = new Set(['a', 'classes', 'create', 'error', 'group', 'number', 'request', 'state', 'target', 'value', '_']);
const ignoredWords = new Set([
'a',
'classes',
'create',
'error',
'group',
'json',
'number',
'request',
'state',
'target',
'value',
'_'
]);
return (docs, words, index) => ignoredWords.has(words[index].toLowerCase()) ? [] : docs;
};