From e6d663f128b70278edafa39fc77fa856f8ceb611 Mon Sep 17 00:00:00 2001 From: taskylizard <75871323+taskylizard@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:04:39 +0000 Subject: [PATCH] fix(theme): toggle starred on new emojis Fixes WEB-10 --- .vitepress/markdown/emoji.ts | 3 +++ .vitepress/markdown/toggleStarred.ts | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.vitepress/markdown/emoji.ts b/.vitepress/markdown/emoji.ts index 1e0937fff..b1009b1b4 100644 --- a/.vitepress/markdown/emoji.ts +++ b/.vitepress/markdown/emoji.ts @@ -11,6 +11,9 @@ export const defs = { export function emojiRender(md: MarkdownRenderer) { md.renderer.rules.emoji = (tokens, idx) => { + if (tokens[idx].markup.startsWith("star")) { + return ``; + } return ``; }; } diff --git a/.vitepress/markdown/toggleStarred.ts b/.vitepress/markdown/toggleStarred.ts index 37024e70d..1ec258d39 100644 --- a/.vitepress/markdown/toggleStarred.ts +++ b/.vitepress/markdown/toggleStarred.ts @@ -8,10 +8,11 @@ export function toggleStarredPlugin(md: MarkdownRenderer) { if ( !excluded.includes(env.frontmatter.title) && contentToken && - contentToken.content.startsWith("⭐") + contentToken.content.startsWith(":star:") ) { return `