@@ -1386,13 +1386,16 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles,
13861386
13871387 } ,
13881388
1389+ formatUrlToLink : function ( sTarget , sText , bSAPHosted ) {
1390+ return `<a target="_blank" rel="noopener noreferrer" href="${ sTarget } ">${ sText } </a>
1391+ <img src="./resources/sap/ui/documentation/sdk/images/${ bSAPHosted ? 'link-sap' : 'link-external' } .png"
1392+ title="Information published on ${ bSAPHosted ? '' : 'non ' } SAP site" class="sapUISDKExternalLink"/>` ;
1393+ } ,
1394+
13891395 handleExternalUrl : function ( sTarget , sText ) {
13901396 // Check if the external domain is SAP hosted
13911397 let bSAPHosted = / ^ h t t p s ? : \/ \/ ( [ \w . ] * \. ) ? (?: s a p | h a n a \. o n d e m a n d | s a p f i o r i t r i a l ) \. c o m / . test ( sTarget ) ;
1392-
1393- return `<a target="_blank" rel="noopener noreferrer" href="${ sTarget } ">${ sText } </a>
1394- <img src="./resources/sap/ui/documentation/sdk/images/${ bSAPHosted ? 'link-sap' : 'link-external' } .png"
1395- title="Information published on ${ bSAPHosted ? '' : 'non ' } SAP site" class="sapUISDKExternalLink"/>` ;
1398+ return this . formatUrlToLink ( sTarget , sText , bSAPHosted ) ;
13961399 } ,
13971400
13981401 /**
@@ -1599,6 +1602,12 @@ title="Information published on ${bSAPHosted ? '' : 'non '}SAP site" class="sapU
15991602 return '<a target="_self" href="topic/' + aMatch [ 1 ] + '">' + sText + '</a>' ;
16001603 }
16011604
1605+ // demo:xxx Demo, open the demonstration page in a new window
1606+ aMatch = sTarget . match ( / ^ d e m o : ( [ a - z A - Z 0 - 9 \/ . ] * ) $ / ) ;
1607+ if ( aMatch ) {
1608+ return this . formatUrlToLink ( "test-resources/" + aMatch [ 1 ] , sText , true ) ;
1609+ }
1610+
16021611 // sap.x.Xxx.prototype.xxx - In case of prototype we have a link to method
16031612 aMatch = sTarget . match ( / ( [ a - z A - Z 0 - 9 . $ _ ] + ?) \. p r o t o t y p e \. ( [ a - z A - Z 0 - 9 . $ _ ] + ) $ / ) ;
16041613 if ( aMatch ) {
0 commit comments