@uiw/react-md-editor 3.13.0 → 3.14.0

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 CHANGED
@@ -207,7 +207,7 @@ The following example is preview in [CodeSandbox](https://codesandbox.io/s/markd
207
207
 
208
208
  [![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/headless-frog-em8yg?fontsize=14&hidenavigation=1&theme=dark)
209
209
 
210
- > ⚠️ Upgrade v2 to v3 [d025430](https://github.com/uiwjs/react-md-editor/blob/d02543050c9abd8f7c72ae02b6421ac2e6ae421a/website/ExmapleKaTeX.tsx#L1-L59)
210
+ > ⚠️ Upgrade v2 to v3 [d025430](https://github.com/uiwjs/react-md-editor/blob/7b9f11ab689a7ea288df3e82c26f4f0e9a53d271/website/ExmapleKaTeX.tsx#L1-L63)
211
211
 
212
212
  ```bash
213
213
  npm install katex
@@ -217,6 +217,7 @@ npm install katex
217
217
  import React from "react";
218
218
  import ReactDOM from "react-dom";
219
219
  import MDEditor from '@uiw/react-md-editor';
220
+ import { getCodeString } from 'rehype-rewrite';
220
221
  import katex from 'katex';
221
222
  import 'katex/dist/katex.css';
222
223
 
@@ -246,15 +247,16 @@ export default function App() {
246
247
  }
247
248
  return <code>{txt}</code>;
248
249
  }
250
+ const code = props.node && props.node.children ? getCodeString(props.node.children) : txt;
249
251
  if (
250
- typeof txt === 'string' &&
252
+ typeof code === 'string' &&
251
253
  typeof className === 'string' &&
252
254
  /^language-katex/.test(className.toLocaleLowerCase())
253
255
  ) {
254
- const html = katex.renderToString(txt, {
256
+ const html = katex.renderToString(code, {
255
257
  throwOnError: false,
256
258
  });
257
- return <code dangerouslySetInnerHTML={{ __html: html }} />;
259
+ return <code style={{ fontSize: '150%' }} dangerouslySetInnerHTML={{ __html: html }} />;
258
260
  }
259
261
  return <code className={String(className)}>{txt}</code>;
260
262
  },
@@ -488,13 +490,13 @@ Inherit custom color variables by adding [`.wmde-markdown-var`](https://github.c
488
490
  - `textareaProps?: TextareaHTMLAttributes`: Set the `textarea` related props.
489
491
  - `renderTextarea?: (props, opts) => JSX.Element;`: Use div to replace TextArea or re-render TextArea. [#193](https://github.com/uiwjs/react-md-editor/issues/193)
490
492
  - `height?: number=200`: The height of the editor.
491
- - `visiableDragbar?: boolean=true`: Show drag and drop tool. Set the height of the editor.
493
+ - `visibleDragbar?: boolean=true`: Show drag and drop tool. Set the height of the editor.
492
494
  - `highlightEnable?: boolean=true`: Disable editing area code highlighting. The value is `false`, which increases the editing speed.
493
495
  - `fullscreen?: boolean=false`: Show markdown preview.
494
496
  - `overflow?: boolean=true`: Disable `fullscreen` setting body styles
495
497
  - `preview?: 'live' | 'edit' | 'preview'`: Default value `live`, Show markdown preview.
496
- - `maxHeight?: number=1200`: Maximum drag height. The `visiableDragbar=true` value is valid.
497
- - `minHeights?: number=100`: Minimum drag height. The `visiableDragbar=true` value is valid.
498
+ - `maxHeight?: number=1200`: Maximum drag height. The `visibleDragbar=true` value is valid.
499
+ - `minHeights?: number=100`: Minimum drag height. The `visibleDragbar=true` value is valid.
498
500
  - `tabSize?: number=2`: The number of characters to insert when pressing tab key. Default `2` spaces.
499
501
  - `defaultTabEnable?: boolean=false`: If `false`, the `tab` key inserts a tab character into the textarea. If `true`, the `tab` key executes default behavior e.g. focus shifts to next element.
500
502
  - `hideToolbar?: boolean=false`: Option to hide the tool bar.
package/dist/mdeditor.css CHANGED
@@ -351,7 +351,6 @@ body[data-color-mode*='light'] {
351
351
  width: -webkit-max-content;
352
352
  width: max-content;
353
353
  max-width: 100%;
354
- overflow: auto;
355
354
  }
356
355
  .wmde-markdown td,
357
356
  .wmde-markdown th {
@@ -387,15 +386,6 @@ body[data-color-mode*='light'] {
387
386
  font-weight: 600;
388
387
  line-height: 1.25;
389
388
  }
390
- .wmde-markdown table {
391
- border-spacing: 0;
392
- border-collapse: collapse;
393
- display: block;
394
- width: -webkit-max-content;
395
- width: max-content;
396
- max-width: 100%;
397
- overflow: auto;
398
- }
399
389
  .wmde-markdown td,
400
390
  .wmde-markdown th {
401
391
  padding: 0;