Skip to content

Commit

Permalink
Another attempt to stop the cells wrapping
Browse files Browse the repository at this point in the history
Signed-off-by: nigel brown <[email protected]>
  • Loading branch information
therealnb committed May 22, 2024
1 parent c5ddaab commit 166579c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/trusty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function descriptionAsTable(details: TrustySummary): string {
const rows = Object.entries(details).map(([key, value]) => {
return `<tr><td>${key}</td><td>${value}</td></tr>`
})
return `<span style="white-space: nowrap;"><details><table>${rows.join('')}</table></details></span>`
return `<details><summary> </summary><table>${rows.join('')}</table></details>`
}

// Function to create an anchor for a change
Expand Down Expand Up @@ -187,7 +187,7 @@ function scoreIcon(change: Change, config: ConfigurationOptions): string {
function scoreCell(change: Change, config: ConfigurationOptions): string {
const icon = scoreIcon(change, config)
const score = change.trusty?.score?.toString()
return `${icon} ${score}`
return `${icon}&nbsp;${score}`
}

// Make it title case...
Expand All @@ -202,15 +202,15 @@ function toTitleCase(str: string): string {
function warningCell(change: Change): string {
const warnings = []
if (change.trusty?.description?.malicious || false) {
warnings.push(`${icons.cross} Malicious`)
warnings.push(`${icons.cross}&nbsp;Malicious`)
}
if (change.trusty?.deprecated || false) {
warnings.push(`${icons.deprecated} Deprecated`)
warnings.push(`${icons.deprecated}&nbsp;Deprecated`)
}
if (change.trusty?.archived || false) {
warnings.push(`${icons.archived} Archived`)
warnings.push(`${icons.archived}&nbsp;Archived`)
}
return `<span style="white-space: nowrap;">${warnings.join(' ')}</span>`
return warnings.join(' ')
}

// Function to convert a change to a summary table row
Expand Down

0 comments on commit 166579c

Please sign in to comment.