diff options
Diffstat (limited to 'src/lib/utils.ts')
-rw-r--r-- | src/lib/utils.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/utils.ts b/src/lib/utils.ts index e7bebb2..e34d573 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -17,6 +17,18 @@ export const colorCodes: { [key: string]: string } = { 'f': '#ffffff', // white } +export const TIER_COLORS = { + COMMON: 'f', + UNCOMMON: 'a', + RARE: '9', + EPIC: '5', + LEGENDARY: '6', + MYTHIC: 'e', + DIVINE: 'b', + SPECIAL: 'c', + VERY_SPECIAL: 'c', +} + const specialCodes: { [key: string]: string } = { 'l': 'font-weight: bold' } @@ -60,6 +72,8 @@ export function formattingCodeToHtml(formatted: string): string { } else if (colorCharacter === 'r') { reset() } + } else if (character === '\n') { + htmlOutput += '<br>' } else { // no xss! htmlOutput += character.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') |