From fa42cdc56e21d6d50f17db6143b74d8b57f179be Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 23 Apr 2022 22:08:29 -0500 Subject: add /items page --- src/lib/utils.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/lib/utils.ts') 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 += '
' } else { // no xss! htmlOutput += character.replace(/&/g, '&').replace(//g, '>') -- cgit