mirror of
https://github.com/jaywcjlove/wxmp.git
synced 2026-01-09 14:58:48 +08:00
type: fix type error.
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"lerna": "^8.0.0",
|
"lerna": "^8.0.0",
|
||||||
"prettier": "^3.0.2",
|
"prettier": "^3.0.2",
|
||||||
|
"react": "~18.2.0",
|
||||||
|
"react-dom": "~18.2.0",
|
||||||
"tsbb": "~4.4.0"
|
"tsbb": "~4.4.0"
|
||||||
},
|
},
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ export default (conf: Configuration, env: 'development' | 'production', options:
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** https://github.com/kktjs/kkt/issues/446 */
|
||||||
|
conf.ignoreWarnings = [{ module: /node_modules[\\/]parse5[\\/]/ }];
|
||||||
conf.module!.exprContextCritical = false;
|
conf.module!.exprContextCritical = false;
|
||||||
if (env === 'production') {
|
if (env === 'production') {
|
||||||
conf.output = { ...conf.output, publicPath: './' };
|
conf.output = { ...conf.output, publicPath: './' };
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
"@uiw/react-markdown-editor": "^6.0.0",
|
"@uiw/react-markdown-editor": "^6.0.0",
|
||||||
"@wcj/dark-mode": "^1.0.15",
|
"@wcj/dark-mode": "^1.0.15",
|
||||||
"css-tree": "^2.2.1",
|
"css-tree": "^2.2.1",
|
||||||
"react": "^18.2.0",
|
"react": "~18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "~18.2.0",
|
||||||
"react-hot-toast": "^2.3.0",
|
"react-hot-toast": "^2.3.0",
|
||||||
"react-router-dom": "^6.3.0",
|
"react-router-dom": "^6.3.0",
|
||||||
"rehype-attr": "^3.0.0",
|
"rehype-attr": "^3.0.0",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import MarkdownEditor, { getCommands } from '@uiw/react-markdown-editor';
|
import MarkdownEditor, { getCommands } from '@uiw/react-markdown-editor';
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
|
// @ts-ignore
|
||||||
import { EditorView } from '@codemirror/view';
|
import { EditorView } from '@codemirror/view';
|
||||||
import { Preview } from './Preview';
|
import { Preview } from './Preview';
|
||||||
import { copy } from '../../commands/copy';
|
import { copy } from '../../commands/copy';
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ export const footnotesLabel = (node: Element) => {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const imagesStyle = (node: Element, parent: Root | Element | null) => {
|
export const imagesStyle = (node: Element, parent: Root | Element | undefined) => {
|
||||||
if (
|
if (
|
||||||
parent?.type === 'element' &&
|
parent?.type === 'element' &&
|
||||||
/(p|a)/.test(parent.tagName) &&
|
/(p|a)/.test(parent.tagName) &&
|
||||||
|
|||||||
@@ -26,21 +26,21 @@ export function markdownToHTML(md: string, css: string, opts: MarkdownToHTMLOpti
|
|||||||
parseCustomProperty: false,
|
parseCustomProperty: false,
|
||||||
positions: false,
|
positions: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const data = cssdata(ast.children.head, {}, { color: opts.preColor, theme: opts.previewTheme });
|
const data = cssdata(ast.children.head, {}, { color: opts.preColor, theme: opts.previewTheme });
|
||||||
const processor = unified()
|
const processor = unified()
|
||||||
.use(remarkParse)
|
.use(remarkParse)
|
||||||
.use(remarkGfm)
|
.use(remarkGfm)
|
||||||
.use(remarkRehype, { allowDangerousHtml: true })
|
.use(remarkRehype, { allowDangerousHtml: true })
|
||||||
|
.use(rehypeRaw)
|
||||||
.use(rehypePrism, {
|
.use(rehypePrism, {
|
||||||
ignoreMissing: true,
|
ignoreMissing: true,
|
||||||
})
|
})
|
||||||
.use(rehypeRaw)
|
|
||||||
.use(rehypeIgnore, {})
|
.use(rehypeIgnore, {})
|
||||||
.use(rehypeAttrs, { properties: 'attr' })
|
.use(rehypeAttrs, { properties: 'attr' })
|
||||||
.use(rehypeRewrite, {
|
.use(rehypeRewrite, {
|
||||||
rewrite: (node, _index, parent) => {
|
rewrite: (node, _index, parent) => {
|
||||||
// @ts-ignore
|
|
||||||
if (
|
if (
|
||||||
node?.type === 'element' &&
|
node?.type === 'element' &&
|
||||||
node?.tagName === 'code' &&
|
node?.tagName === 'code' &&
|
||||||
|
|||||||
Reference in New Issue
Block a user