mirror of
https://github.com/fmhy/edit.git
synced 2026-01-18 01:41:52 +11:00
style: format with new style
This commit is contained in:
parent
bc3bbaafeb
commit
ef422dcda8
43 changed files with 686 additions and 583 deletions
|
|
@ -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)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue