@uiw/react-md-editor 3.20.7 → 3.20.9

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.
@@ -1,13 +1,3 @@
1
- /*!
2
- * @uiw/copy-to-clipboard v1.0.12
3
- * Copy to clipboard.
4
- *
5
- * Copyright (c) 2021 Kenny Wang
6
- * https://github.com/uiwjs/copy-to-clipboard.git
7
- *
8
- * Licensed under the MIT license.
9
- */
10
-
11
1
  /*!
12
2
  * Determine if an object is a Buffer
13
3
  *
@@ -34,3 +24,15 @@
34
24
  * This source code is licensed under the MIT license found in the
35
25
  * LICENSE file in the root directory of this source tree.
36
26
  */
27
+
28
+ /**!
29
+ * @uiw/copy-to-clipboard v1.0.14
30
+ * Copy to clipboard.
31
+ *
32
+ * Copyright (c) 2023 Kenny Wang
33
+ * https://github.com/uiwjs/copy-to-clipboard.git
34
+ *
35
+ * @website: https://uiwjs.github.io/copy-to-clipboard
36
+
37
+ * Licensed under the MIT license
38
+ */
package/esm/Editor.d.ts CHANGED
@@ -31,7 +31,7 @@ export interface MDEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>
31
31
  * The height of the editor.
32
32
  * ⚠️ `Dragbar` is invalid when **`height`** parameter percentage.
33
33
  */
34
- height?: number;
34
+ height?: CSSProperties['height'];
35
35
  /**
36
36
  * Custom toolbar heigth
37
37
  * @default 29px
@@ -6,14 +6,14 @@ import rehypePrism from 'rehype-prism-plus';
6
6
  import { EditorContext } from '../../Context';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  function html2Escape(sHtml) {
9
- return sHtml.replace(/```(\w+)?([\s\S]*?)(\s.+)?```/g, str => {
10
- return str.replace(/[<&"]/g, c => ({
11
- '<': '&lt;',
12
- '>': '&gt;',
13
- '&': '&amp;',
14
- '"': '&quot;'
15
- })[c]);
16
- }).replace(/[<&"]/g, c => ({
9
+ return sHtml
10
+ // .replace(/```(\w+)?([\s\S]*?)(\s.+)?```/g, (str: string) => {
11
+ // return str.replace(
12
+ // /[<&"]/g,
13
+ // (c: string) => (({ '<': '&lt;', '>': '&gt;', '&': '&amp;', '"': '&quot;' } as Record<string, string>)[c]),
14
+ // );
15
+ // })
16
+ .replace(/[<&"]/g, c => ({
17
17
  '<': '&lt;',
18
18
  '>': '&gt;',
19
19
  '&': '&amp;',
package/lib/Editor.d.ts CHANGED
@@ -31,7 +31,7 @@ export interface MDEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>
31
31
  * The height of the editor.
32
32
  * ⚠️ `Dragbar` is invalid when **`height`** parameter percentage.
33
33
  */
34
- height?: number;
34
+ height?: CSSProperties['height'];
35
35
  /**
36
36
  * Custom toolbar heigth
37
37
  * @default 29px
@@ -14,16 +14,14 @@ var _Context = require("../../Context");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  var _templateObject;
16
16
  function html2Escape(sHtml) {
17
- return sHtml.replace(/```(\w+)?([\s\S]*?)(\s.+)?```/g, function (str) {
18
- return str.replace(/[<&"]/g, function (c) {
19
- return {
20
- '<': '&lt;',
21
- '>': '&gt;',
22
- '&': '&amp;',
23
- '"': '&quot;'
24
- }[c];
25
- });
26
- }).replace(/[<&"]/g, function (c) {
17
+ return sHtml
18
+ // .replace(/```(\w+)?([\s\S]*?)(\s.+)?```/g, (str: string) => {
19
+ // return str.replace(
20
+ // /[<&"]/g,
21
+ // (c: string) => (({ '<': '&lt;', '>': '&gt;', '&': '&amp;', '"': '&quot;' } as Record<string, string>)[c]),
22
+ // );
23
+ // })
24
+ .replace(/[<&"]/g, function (c) {
27
25
  return {
28
26
  '<': '&lt;',
29
27
  '>': '&gt;',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uiw/react-md-editor",
3
- "version": "3.20.7",
3
+ "version": "3.20.9",
4
4
  "description": "A markdown editor with preview, implemented with React.js and TypeScript.",
5
5
  "homepage": "https://uiwjs.github.io/react-md-editor/",
6
6
  "author": "kenny wang <wowohoo@qq.com>",
package/src/Editor.tsx CHANGED
@@ -35,7 +35,7 @@ export interface MDEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>
35
35
  * The height of the editor.
36
36
  * ⚠️ `Dragbar` is invalid when **`height`** parameter percentage.
37
37
  */
38
- height?: number;
38
+ height?: CSSProperties['height'];
39
39
  /**
40
40
  * Custom toolbar heigth
41
41
  * @default 29px
@@ -5,17 +5,19 @@ import { IProps } from '../../Editor';
5
5
  import { EditorContext } from '../../Context';
6
6
 
7
7
  function html2Escape(sHtml: string) {
8
- return sHtml
9
- .replace(/```(\w+)?([\s\S]*?)(\s.+)?```/g, (str: string) => {
10
- return str.replace(
8
+ return (
9
+ sHtml
10
+ // .replace(/```(\w+)?([\s\S]*?)(\s.+)?```/g, (str: string) => {
11
+ // return str.replace(
12
+ // /[<&"]/g,
13
+ // (c: string) => (({ '<': '&lt;', '>': '&gt;', '&': '&amp;', '"': '&quot;' } as Record<string, string>)[c]),
14
+ // );
15
+ // })
16
+ .replace(
11
17
  /[<&"]/g,
12
18
  (c: string) => (({ '<': '&lt;', '>': '&gt;', '&': '&amp;', '"': '&quot;' } as Record<string, string>)[c]),
13
- );
14
- })
15
- .replace(
16
- /[<&"]/g,
17
- (c: string) => (({ '<': '&lt;', '>': '&gt;', '&': '&amp;', '"': '&quot;' } as Record<string, string>)[c]),
18
- );
19
+ )
20
+ );
19
21
  }
20
22
 
21
23
  export interface MarkdownProps extends IProps, React.HTMLAttributes<HTMLPreElement> {}