mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
feat(docs-infra): remove redundant JSDoc transform related to code examples (#59004)
The transform is no longer relevant nor it served any functional purpose. PR Close #59004
This commit is contained in:
parent
8eb20463bf
commit
7e4d312aed
1 changed files with 1 additions and 14 deletions
|
|
@ -101,9 +101,7 @@ export function addHtmlUsageNotes<T extends HasJsDocTags>(entry: T): T & HasHtml
|
|||
({name}) => name === JS_DOC_USAGE_NOTES_TAG || name === JS_DOC_REMARKS_TAG,
|
||||
);
|
||||
const htmlUsageNotes = usageNotesTag
|
||||
? (marked.parse(
|
||||
convertJsDocExampleToHtmlExample(wrapExampleHtmlElementsWithCode(usageNotesTag.comment)),
|
||||
) as string)
|
||||
? (marked.parse(wrapExampleHtmlElementsWithCode(usageNotesTag.comment)) as string)
|
||||
: '';
|
||||
|
||||
const transformedHtml = addApiLinksToHtml(htmlUsageNotes);
|
||||
|
|
@ -178,17 +176,6 @@ function wrapExampleHtmlElementsWithCode(text: string) {
|
|||
.replace(/'<img>'/g, `<code><img></code>`);
|
||||
}
|
||||
|
||||
function convertJsDocExampleToHtmlExample(text: string): string {
|
||||
const codeExampleAtRule = /{@example (\S+) region=(['"])([^'"]+)\2\s*}/g;
|
||||
|
||||
return text.replace(
|
||||
codeExampleAtRule,
|
||||
(_: string, path: string, separator: string, region: string) => {
|
||||
return `<code-example path="${path}" region="${region}" />`;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts {@link } tags into html anchor elements
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue