@@ -512,7 +512,7 @@ exports.publish = function(taffyData, opts, tutorials) {
512512// Taken from templateHelper.js in jsdoc/util
513513
514514function linkTo ( longname , linkText , cssClass , fragmentId ) {
515- const classString = cssClass ? util . format ( ' class="%s"' , cssClass ) : '' ;
515+ const classString = getCssClassString ( cssClass ) ;
516516 let fileUrl ;
517517 let fragmentString = fragmentId ? `#${ fragmentId } ` : '' ;
518518 let stripped ;
@@ -612,7 +612,7 @@ function isComplexTypeExpression(expr) {
612612}
613613
614614function linkComplexType ( longname , linkText , cssClass ) {
615- const classString = cssClass ? util . format ( ' class="%s"' , cssClass ) : '' ;
615+ const classString = getCssClassString ( cssClass ) ;
616616
617617 // Handle type unions (e.g., "string | number")
618618 if ( / ^ .+ \| .+ $ / . test ( longname ) && ! / < .+ > / . test ( longname ) ) {
@@ -630,7 +630,7 @@ function linkComplexType(longname, linkText, cssClass) {
630630
631631 // Handle generic types (e.g., "Array.<string>", "Promise.<@ui5/fs/Resource>")
632632 if ( / < .+ > / . test ( longname ) ) {
633- return linkGenericType ( longname , classString ) ;
633+ return linkGenericType ( longname , cssClass ) ;
634634 }
635635
636636 // Handle record types (e.g., "{a: string, b: number}")
@@ -642,7 +642,8 @@ function linkComplexType(longname, linkText, cssClass) {
642642 return linkText || htmlsafe ( longname ) ;
643643}
644644
645- function linkGenericType ( type , classString ) {
645+ function linkGenericType ( type , cssClass ) {
646+ const classString = getCssClassString ( cssClass ) ;
646647 // Match patterns like "Promise.<Type>" or "Array.<Type>" or "Promise.<Array.<Type>>"
647648 const match = type . match ( / ^ ( [ ^ < ] + ) < ( .+ ) > $ / ) ;
648649
@@ -672,7 +673,7 @@ function linkGenericType(type, classString) {
672673
673674 // Recursively handle the inner type
674675 if ( isComplexTypeExpression ( innerType ) ) {
675- result += linkComplexType ( innerType , null , classString . replace ( ' class="' , '' ) . replace ( '"' , '' ) ) ;
676+ result += linkComplexType ( innerType , null , cssClass ) ;
676677 } else {
677678 let innerUrl = helper . longnameToUrl [ innerType ] ;
678679 if ( innerUrl ) {
@@ -688,3 +689,7 @@ function linkGenericType(type, classString) {
688689
689690 return result ;
690691}
692+
693+ function getCssClassString ( cssClass ) {
694+ return cssClass ? util . format ( ' class="%s"' , cssClass ) : '' ;
695+ }
0 commit comments