Skip to content

Commit

Permalink
fix: remove > from quoted text
Browse files Browse the repository at this point in the history
  • Loading branch information
irony committed Mar 28, 2024
1 parent c37e4bb commit 2a5100b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/lib/discordTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,13 @@ const trimText = (text: string | number = '', length: number = 12) =>

export const summaryTable = async (company: CompanyData) => {
if (!company.emissions) {
return '> *Ingen data rapporterad*'
return '*Ingen data rapporterad*'
}

const emissions = company.emissions?.sort((a, b) => b.year - a.year)

const table = [
[
'> ' + trimText('** CO2'),
...emissions.map((e) => trimText(e.year)),
'**',
],
[trimText('** CO2'), ...emissions.map((e) => trimText(e.year)), '**'],
[
trimText('Scope 1'),
...emissions.map((e) => trimText(e.scope1?.emissions) || trimText('-')),
Expand All @@ -86,7 +82,7 @@ export const summaryTable = async (company: CompanyData) => {

export const scope3Table = async (company: CompanyData) => {
if (!company.emissions) {
return '> *Ingen data rapporterad*'
return '*Ingen data rapporterad*'
}

const emissions = company.emissions?.sort((a, b) => b.year - a.year)
Expand All @@ -95,11 +91,11 @@ export const scope3Table = async (company: CompanyData) => {
.flat()

if (!categories.length) {
return '> *Ingen Scope 3 data rapporterad*'
return '*Ingen Scope 3 data rapporterad*'
}
const table = [
...categories.map((c) => [
'> ' + trimText(c),
trimText(c),
...emissions.map(
(e) => trimText(e.scope3?.categories[c]) || trimText('-')
),
Expand Down

0 comments on commit 2a5100b

Please sign in to comment.