Skip to content

Commit

Permalink
type: fix type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 4, 2024
1 parent 8b4194f commit d85368c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions website/.kktrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: './' };
Expand Down
4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion website/src/utils/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down
4 changes: 2 additions & 2 deletions website/src/utils/markdownToHTML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down

0 comments on commit d85368c

Please sign in to comment.