@uiw/react-md-editor 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -21
- package/dist/mdeditor.js +722 -246
- package/dist/mdeditor.min.js +1 -1
- package/esm/Context.d.ts +1 -1
- package/esm/commands/issue.js +0 -1
- package/esm/commands/table.js +0 -1
- package/lib/Context.d.ts +1 -1
- package/lib/commands/issue.js +0 -1
- package/lib/commands/table.js +0 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
+
<a href="https://jaywcjlove.github.io/#/sponsor" target="__blank">
|
|
10
|
+
<img alt="Buy me a coffee" src="https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee">
|
|
11
|
+
</a>
|
|
9
12
|
<a href="https://www.npmjs.com/package/@uiw/react-md-editor" target="__blank">
|
|
10
13
|
<img alt="Downloads" src="https://img.shields.io/npm/dm/@uiw/react-md-editor.svg?style=flat">
|
|
11
14
|
</a>
|
|
12
|
-
<a href="https://www.jsdelivr.com/package/npm/@uiw/react-md-editor" target="__blank">
|
|
13
|
-
<img alt="jsDelivr CDN" src="https://data.jsdelivr.com/v1/package/npm/@uiw/react-md-editor/badge?style=rounded" />
|
|
14
|
-
</a>
|
|
15
15
|
<a href="https://bundlephobia.com/package/@uiw/react-md-editor" target="__blank">
|
|
16
16
|
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/@uiw/react-md-editor">
|
|
17
17
|
</a>
|
|
@@ -508,8 +508,8 @@ export default function App() {
|
|
|
508
508
|
[](https://github.com/uiwjs/react-md-editor/issues/425#issuecomment-1209514536)
|
|
509
509
|
|
|
510
510
|
```css
|
|
511
|
-
.w-md-editor-text-pre > code,
|
|
512
|
-
.w-md-editor-text-input {
|
|
511
|
+
body .w-md-editor-text-pre > code,
|
|
512
|
+
body .w-md-editor-text-input {
|
|
513
513
|
font-size: 23px !important;
|
|
514
514
|
line-height: 24px !important;
|
|
515
515
|
}
|
|
@@ -594,18 +594,14 @@ export default function App() {
|
|
|
594
594
|
onChange={(val) => setValue(val)}
|
|
595
595
|
previewOptions={{
|
|
596
596
|
components: {
|
|
597
|
-
code: ({
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
});
|
|
604
|
-
return <code dangerouslySetInnerHTML={{ __html: html }} />;
|
|
605
|
-
}
|
|
606
|
-
return <code>{txt}</code>;
|
|
597
|
+
code: ({ children = [], className, ...props }) => {
|
|
598
|
+
if (typeof children === 'string' && /^\$\$(.*)\$\$/.test(children)) {
|
|
599
|
+
const html = katex.renderToString(children.replace(/^\$\$(.*)\$\$/, '$1'), {
|
|
600
|
+
throwOnError: false,
|
|
601
|
+
});
|
|
602
|
+
return <code dangerouslySetInnerHTML={{ __html: html }} style={{ background: 'transparent' }} />;
|
|
607
603
|
}
|
|
608
|
-
const code = props.node && props.node.children ? getCodeString(props.node.children) :
|
|
604
|
+
const code = props.node && props.node.children ? getCodeString(props.node.children) : children;
|
|
609
605
|
if (
|
|
610
606
|
typeof code === 'string' &&
|
|
611
607
|
typeof className === 'string' &&
|
|
@@ -729,7 +725,6 @@ const Code = ({ inline, children = [], className, ...props }) => {
|
|
|
729
725
|
mermaid
|
|
730
726
|
.render(demoid.current, code)
|
|
731
727
|
.then(({ svg, bindFunctions }) => {
|
|
732
|
-
console.log("svg:", svg);
|
|
733
728
|
container.innerHTML = svg;
|
|
734
729
|
if (bindFunctions) {
|
|
735
730
|
bindFunctions(container);
|
|
@@ -855,7 +850,7 @@ Inherit custom color variables by adding [`.wmde-markdown-var`](https://github.c
|
|
|
855
850
|
- `commandsFilter?: (command: ICommand, isExtra: boolean) => false | ICommand`: Filter or modify your commands.
|
|
856
851
|
- `extraCommands?: ICommand[]`: Displayed on the right side of the toolbar.
|
|
857
852
|
- `autoFocus?: true`: Can be used to make `Markdown Editor` focus itself on initialization.
|
|
858
|
-
- `previewOptions?: ReactMarkdown.ReactMarkdownProps`: This is reset [@uiw/react-markdown-preview](https://github.com/uiwjs/react-markdown-preview/tree/
|
|
853
|
+
- `previewOptions?: ReactMarkdown.ReactMarkdownProps`: This is reset [@uiw/react-markdown-preview](https://github.com/uiwjs/react-markdown-preview/tree/0036dd51a25c00d5be6dc83aa978905c64750038?tab=readme-ov-file#options-props) settings.
|
|
859
854
|
- `textareaProps?: TextareaHTMLAttributes`: Set the `textarea` related props.
|
|
860
855
|
- ~~`renderTextarea?: (props, opts) => JSX.Element;`~~: `@deprecated` Please use ~~`renderTextarea`~~ -> `components`. Use div to replace TextArea or re-render TextArea. [#193](https://github.com/uiwjs/react-md-editor/issues/193)
|
|
861
856
|
- `components`: re-render textarea/toolbar element. [#419](https://github.com/uiwjs/react-md-editor/issues/419)
|
|
@@ -945,8 +940,8 @@ As always, thanks to our amazing contributors!
|
|
|
945
940
|
<a href="https://github.com/MercierCorentin" title="Corentin Mercier">
|
|
946
941
|
<img src="https://avatars.githubusercontent.com/u/46066895?v=4" width="42;" alt="Corentin Mercier"/>
|
|
947
942
|
</a>
|
|
948
|
-
<a href="https://github.com/dmitriyyan" title="
|
|
949
|
-
<img src="https://avatars.githubusercontent.com/u/89025862?v=4" width="42;" alt="
|
|
943
|
+
<a href="https://github.com/dmitriyyan" title="Dmitrii Ianushkevich">
|
|
944
|
+
<img src="https://avatars.githubusercontent.com/u/89025862?v=4" width="42;" alt="Dmitrii Ianushkevich"/>
|
|
950
945
|
</a>
|
|
951
946
|
<a href="https://github.com/jnishiyama" title="James Finucane">
|
|
952
947
|
<img src="https://avatars.githubusercontent.com/u/2048195?v=4" width="42;" alt="James Finucane"/>
|
|
@@ -966,6 +961,9 @@ As always, thanks to our amazing contributors!
|
|
|
966
961
|
<a href="https://github.com/phillipb" title="Phillip Burch">
|
|
967
962
|
<img src="https://avatars.githubusercontent.com/u/1482089?v=4" width="42;" alt="Phillip Burch"/>
|
|
968
963
|
</a>
|
|
964
|
+
<a href="https://github.com/psycho-baller" title="Rami Maalouf">
|
|
965
|
+
<img src="https://avatars.githubusercontent.com/u/81759594?v=4" width="42;" alt="Rami Maalouf"/>
|
|
966
|
+
</a>
|
|
969
967
|
<a href="https://github.com/toresbe" title="Tore Sinding Bekkedal">
|
|
970
968
|
<img src="https://avatars.githubusercontent.com/u/1761606?v=4" width="42;" alt="Tore Sinding Bekkedal"/>
|
|
971
969
|
</a>
|
|
@@ -985,7 +983,7 @@ As always, thanks to our amazing contributors!
|
|
|
985
983
|
<img src="https://avatars.githubusercontent.com/u/8792016?v=4" width="42;" alt="wangjie"/>
|
|
986
984
|
</a><!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-END-->
|
|
987
985
|
|
|
988
|
-
Made with [
|
|
986
|
+
Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).
|
|
989
987
|
|
|
990
988
|
### License
|
|
991
989
|
|