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 Nov 29, 2023
1 parent 8d29326 commit f3c67d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ https://uiwjs.github.io/react-textarea-code-editor/
[![Open in Github gh-pages](https://img.shields.io/badge/Open%20In-Github%20gh--pages-blue?logo=github)](https://uiwjs.github.io/react-textarea-code-editor/)

```jsx
import React, { useState } from "react";
import CodeEditor from '@uiw/react-textarea-code-editor';

function App() {
const [code, setCode] = React.useState(
export default function App() {
const [code, setCode] = useState(
`function add(a, b) {\n return a + b;\n}`
);
return (
Expand All @@ -53,7 +54,6 @@ function App() {
onChange={(evn) => setCode(evn.target.value)}
padding={15}
style={{
fontSize: 12,
backgroundColor: "#f5f5f5",
fontFamily: 'ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace',
}}
Expand Down
7 changes: 5 additions & 2 deletions core/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { PluggableList } from 'unified';
import { PluggableList, Pluggable } from 'unified';
import { rehype } from 'rehype';
import rehypePrism from 'rehype-prism-plus';

export const processHtml = (html: string, plugins: PluggableList = [[rehypePrism, { ignoreMissing: true }]]) => {
export const processHtml = (
html: string,
plugins: PluggableList = [[rehypePrism, { ignoreMissing: true }]] as Pluggable[],
) => {
return rehype()
.data('settings', { fragment: true })
.use([...plugins])
Expand Down

0 comments on commit f3c67d7

Please sign in to comment.