diff --git a/main.ts b/main.ts index 0ea58a0..827dfa0 100644 --- a/main.ts +++ b/main.ts @@ -78,9 +78,12 @@ export default class DiscordTimestamps extends Plugin { else { newEl.appendText(textSlices[i]); } - if (i < timestampSlices.length) { + if (i < timestampSlices.length && i < timestampHover.length) { newEl.createEl('span', { text: timestampSlices[i], cls: 'discord-timestamps' }).ariaLabel = timestampHover[i] } + else if (timestampSlices.length !== timestampHover.length) { + console.error("The lengths of timestampSlices and timestampHover are NOT EQUAL!"); + } } if (text !== "") { newEl.appendText(text);