fix(theme): toggle starred on new emojis
Fixes WEB-10
This commit is contained in:
parent
0e69461b59
commit
e6d663f128
@ -11,6 +11,9 @@ export const defs = {
|
|||||||
|
|
||||||
export function emojiRender(md: MarkdownRenderer) {
|
export function emojiRender(md: MarkdownRenderer) {
|
||||||
md.renderer.rules.emoji = (tokens, idx) => {
|
md.renderer.rules.emoji = (tokens, idx) => {
|
||||||
|
if (tokens[idx].markup.startsWith("star")) {
|
||||||
|
return `<span class="i-twemoji-${tokens[idx].markup} starred"></span>`;
|
||||||
|
}
|
||||||
return `<span class="i-twemoji-${tokens[idx].markup}"></span>`;
|
return `<span class="i-twemoji-${tokens[idx].markup}"></span>`;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,11 @@ export function toggleStarredPlugin(md: MarkdownRenderer) {
|
|||||||
if (
|
if (
|
||||||
!excluded.includes(env.frontmatter.title) &&
|
!excluded.includes(env.frontmatter.title) &&
|
||||||
contentToken &&
|
contentToken &&
|
||||||
contentToken.content.startsWith("⭐")
|
contentToken.content.startsWith(":star:")
|
||||||
) {
|
) {
|
||||||
return `<li class="starred">`;
|
return `<li class="starred">`;
|
||||||
}
|
} else {
|
||||||
return self.renderToken(tokens, index, options);
|
return self.renderToken(tokens, index, options);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user