@@ -58,16 +58,10 @@ export function addHtmlDescription<T extends HasDescription & HasModuleName>(
5858
5959 const description = ! ! entry . description ? entry . description : jsDocDescription ;
6060 const shortTextMatch = description . match ( firstParagraphRule ) ;
61- const htmlDescription = getHtmlForJsDocText ( description , entry ) . trim ( ) ;
62- const shortHtmlDescription = getHtmlForJsDocText (
63- shortTextMatch ? shortTextMatch [ 0 ] : '' ,
64- entry ,
65- ) . trim ( ) ;
66- return {
67- ...entry ,
68- htmlDescription,
69- shortHtmlDescription,
70- } ;
61+ const htmlDescription = getHtmlForJsDocText ( description ) . trim ( ) ;
62+ const shortHtmlDescription = getHtmlForJsDocText ( shortTextMatch ? shortTextMatch [ 0 ] : '' ) . trim ( ) ;
63+
64+ return { ...entry , htmlDescription, shortHtmlDescription} ;
7165}
7266
7367/**
@@ -81,7 +75,7 @@ export function addHtmlJsDocTagComments<T extends HasJsDocTags & HasModuleName>(
8175 ...entry ,
8276 jsdocTags : entry . jsdocTags . map ( ( tag ) => ( {
8377 ...tag ,
84- htmlComment : getHtmlForJsDocText ( tag . comment , entry ) ,
78+ htmlComment : getHtmlForJsDocText ( tag . comment ) ,
8579 } ) ) ,
8680 } ;
8781}
@@ -100,20 +94,16 @@ export function addHtmlUsageNotes<T extends HasJsDocTags>(entry: T): T & HasHtml
10094 const usageNotesTag = entry . jsdocTags . find (
10195 ( { name} ) => name === JS_DOC_USAGE_NOTES_TAG || name === JS_DOC_REMARKS_TAG ,
10296 ) ;
103- const htmlUsageNotes = usageNotesTag
104- ? ( marked . parse ( wrapExampleHtmlElementsWithCode ( usageNotesTag . comment ) ) as string )
105- : '' ;
106-
107- const transformedHtml = addApiLinksToHtml ( htmlUsageNotes ) ;
97+ const htmlUsageNotes = usageNotesTag ? getHtmlForJsDocText ( usageNotesTag . comment ) : '' ;
10898
10999 return {
110100 ...entry ,
111- htmlUsageNotes : transformedHtml ,
101+ htmlUsageNotes,
112102 } ;
113103}
114104
115105/** Given a markdown JsDoc text, gets the rendered HTML. */
116- function getHtmlForJsDocText < T extends HasModuleName > ( text : string , entry : T ) : string {
106+ function getHtmlForJsDocText ( text : string ) : string {
117107 const parsed = marked . parse ( convertLinks ( wrapExampleHtmlElementsWithCode ( text ) ) ) as string ;
118108 return addApiLinksToHtml ( parsed ) ;
119109}
@@ -126,7 +116,7 @@ export function setEntryFlags<T extends HasJsDocTags & HasModuleName>(
126116 ...entry ,
127117 isDeprecated : isDeprecatedEntry ( entry ) ,
128118 deprecationMessage : deprecationMessage
129- ? getHtmlForJsDocText ( deprecationMessage , entry )
119+ ? getHtmlForJsDocText ( deprecationMessage )
130120 : deprecationMessage ,
131121 isDeveloperPreview : isDeveloperPreview ( entry ) ,
132122 isExperimental : isExperimental ( entry ) ,
0 commit comments