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