Skip to content

Commit

Permalink
[config][pages] display name transformation: uppercase on first lette…
Browse files Browse the repository at this point in the history
…r only
  • Loading branch information
jonathanpoelen committed Nov 15, 2023
1 parent 66852c8 commit 0af6d91
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions projects/redemption_configs/pages/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,9 @@
}

const computeDisplayName = (name) => {
// aaa_bbb_ccc -> Aaa Bbb Ccc
return name.replace(
/([a-zA-Z0-9]+)(_?)/g,
(_, s, sep) => `${s[0].toUpperCase()}${s.substr(1)}${sep ? ' ' : ''}`
);
// aaa_bbb_ccc -> Aaa bbb ccc
name = name.replaceAll('_', ' ');
return name.charAt(0).toUpperCase() + name.slice(1);
};

const computeSpecInfo = (spec) => {
Expand Down

0 comments on commit 0af6d91

Please sign in to comment.