File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
frontend/routes/package/(_islands) Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ function renderDependency(
236236 content = `${ tooltip } \n${
237237 dependency . entrypoints . map ( ( entrypoint ) => {
238238 if ( entrypoint == "." ) {
239- return "<I >default entrypoint</I >" ;
239+ return "<i >default entrypoint</i >" ;
240240 } else {
241241 return entrypoint ;
242242 }
@@ -262,11 +262,22 @@ function renderDependency(
262262 break ;
263263 }
264264
265+ const renderAttributeValue = ( content ?: string ) => {
266+ if ( ! content ) return content ;
267+
268+ const hasHTMLTag = / < i > ( .+ ?) < \/ i > / . test ( content ) ;
269+ if ( hasHTMLTag ) {
270+ const htmlContent = content . replace ( / \n / g, "<br/>" ) ;
271+ return `<${ htmlContent } >` ;
272+ }
273+ return `"${ content } "` ;
274+ } ;
275+
265276 return `[${
266277 Object
267278 . entries ( { href, tooltip, label : content , color } )
268279 . filter ( ( [ _ , v ] ) => v )
269- . map ( ( [ k , v ] ) => `${ k } =" ${ v } " ` )
280+ . map ( ( [ k , v ] ) => `${ k } =${ renderAttributeValue ( v ) } ` )
270281 . join ( ", " )
271282 } ]`;
272283}
You can’t perform that action at this time.
0 commit comments