style: format with new style

This commit is contained in:
taskylizard 2024-01-25 16:32:45 +00:00
parent bc3bbaafeb
commit ef422dcda8
No known key found for this signature in database
GPG key ID: 1820131ED1A24120
43 changed files with 686 additions and 583 deletions

View file

@ -1,18 +1,18 @@
import type { MarkdownRenderer } from "vitepress";
import type { MarkdownRenderer } from 'vitepress'
const excluded = ["Beginners Guide"];
const excluded = ['Beginners Guide']
export function toggleStarredPlugin(md: MarkdownRenderer) {
md.renderer.rules.list_item_open = (tokens, index, options, env, self) => {
const contentToken = tokens[index + 2];
const contentToken = tokens[index + 2]
if (
!excluded.includes(env.frontmatter.title) &&
contentToken &&
contentToken.content.startsWith(":star:")
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)
}
};
}
}