mirror of
https://github.com/doocs/md.git
synced 2025-02-11 09:10:08 +08:00
feat: GFM style changed by theme
This commit is contained in:
parent
014e4b4aea
commit
8dcc2c2756
@ -2,7 +2,6 @@ import DEFAULT_CONTENT from '@/assets/example/markdown.md?raw'
|
||||
import DEFAULT_CSS_CONTENT from '@/assets/example/theme-css.txt?raw'
|
||||
import { altKey, codeBlockThemeOptions, colorOptions, fontFamilyOptions, fontSizeOptions, legendOptions, shiftKey, themeMap, themeOptions } from '@/config'
|
||||
import { addPrefix, css2json, customCssWithTemplate, customizeTheme, downloadMD, exportHTML, formatDoc } from '@/utils'
|
||||
import markedAlert from '@/utils/MDAlert'
|
||||
import { initRenderer } from '@/utils/renderer'
|
||||
import { useDark, useStorage, useToggle } from '@vueuse/core'
|
||||
|
||||
@ -186,7 +185,6 @@ export const useStore = defineStore(`store`, () => {
|
||||
renderer.setOptions({
|
||||
theme: newTheme,
|
||||
})
|
||||
marked.use(markedAlert({ theme: newTheme }))
|
||||
|
||||
editorRefresh()
|
||||
}
|
||||
|
@ -104,8 +104,6 @@ export function initRenderer(opts: IOpts) {
|
||||
let listIndex: number = 0
|
||||
let isOrdered: boolean = false
|
||||
|
||||
marked.use(markedAlert({ theme: opts.theme }))
|
||||
|
||||
function styles(tag: string, addition: string = ``): string {
|
||||
return getStyles(styleMapping, tag, addition)
|
||||
}
|
||||
@ -129,6 +127,7 @@ export function initRenderer(opts: IOpts) {
|
||||
function setOptions(newOpts: Partial<IOpts>): void {
|
||||
opts = { ...opts, ...newOpts }
|
||||
styleMapping = buildTheme(opts)
|
||||
marked.use(markedAlert({ theme: opts.theme }))
|
||||
}
|
||||
|
||||
const buildFootnotes = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user