@modusoperandi/licit 0.13.18 → 0.13.20

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.
@@ -15,14 +15,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
15
15
 
16
16
  function convertFromHTML(html, schema, plugins) {
17
17
  const root = document.createElement('html');
18
- root.innerHTML = unEscape(html ? html : ' ');
18
+ root.innerHTML = html ? html : ' ';
19
19
  return (0, _convertFromDOMElement.default)(root, schema, plugins);
20
- }
21
-
22
- function unEscape(htmlStr) {
23
- if (htmlStr) {
24
- htmlStr = htmlStr.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, '&');
25
- }
26
-
27
- return htmlStr;
28
20
  }
@@ -12,18 +12,6 @@ export default function convertFromHTML(
12
12
  plugins: Array<Plugin>
13
13
  ): EditorState {
14
14
  const root = document.createElement('html');
15
- root.innerHTML = unEscape(html ? html : ' ');
15
+ root.innerHTML = html ? html : ' ';
16
16
  return convertFromDOMElement(root, schema, plugins);
17
17
  }
18
-
19
- function unEscape(htmlStr) {
20
- if (htmlStr) {
21
- htmlStr = htmlStr
22
- .replace(/&lt;/g, '<')
23
- .replace(/&gt;/g, '>')
24
- .replace(/&quot;/g, '"')
25
- .replace(/&#39;/g, "'")
26
- .replace(/&amp;/g, '&');
27
- }
28
- return htmlStr;
29
- }
@@ -93,7 +93,12 @@ function readStreamAsJSON(stream, callback) {
93
93
  stream.on('end', () => {
94
94
  let result, error;
95
95
  try {
96
- result = JSON.parse(data);
96
+ if (typeof data === 'string') {
97
+ result = JSON.parse(data);
98
+ }
99
+ else {
100
+ result = data;
101
+ }
97
102
  } catch (e) {
98
103
  error = e;
99
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modusoperandi/licit",
3
- "version": "0.13.18",
3
+ "version": "0.13.20",
4
4
  "subversion": "1",
5
5
  "description": "Rich text editor built with React and ProseMirror",
6
6
  "main": "dist/index.js",
@@ -89,8 +89,8 @@
89
89
  "write-file-webpack-plugin": "4.5.1"
90
90
  },
91
91
  "dependencies": {
92
- "@modusoperandi/licit-doc-attrs-step": "^0.1.2",
93
- "@modusoperandi/licit-ui-commands": "^0.1.5",
92
+ "@modusoperandi/licit-doc-attrs-step": "^0.1.3",
93
+ "@modusoperandi/licit-ui-commands": "^0.1.6",
94
94
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
95
95
  "body-parser": "^1.19.0",
96
96
  "browserkeymap": "2.0.2",
@@ -29,7 +29,7 @@ const ListItemNodeSpec: NodeSpec = {
29
29
  // This spec does not support nested lists (e.g. `'paragraph block*'`)
30
30
  // as content because of the complexity of dealing with indentation
31
31
  // (context: https://github.com/ProseMirror/prosemirror/issues/92).
32
- content: 'paragraph',
32
+ content: '(bullet_list|paragraph)+',
33
33
 
34
34
  parseDOM: [{ tag: 'li', getAttrs }],
35
35
 
@@ -12,18 +12,6 @@ export default function convertFromHTML(
12
12
  plugins: Array<Plugin>
13
13
  ): EditorState {
14
14
  const root = document.createElement('html');
15
- root.innerHTML = unEscape(html ? html : ' ');
15
+ root.innerHTML = html ? html : ' ';
16
16
  return convertFromDOMElement(root, schema, plugins);
17
17
  }
18
-
19
- function unEscape(htmlStr) {
20
- if (htmlStr) {
21
- htmlStr = htmlStr
22
- .replace(/&lt;/g, '<')
23
- .replace(/&gt;/g, '>')
24
- .replace(/&quot;/g, '"')
25
- .replace(/&#39;/g, "'")
26
- .replace(/&amp;/g, '&');
27
- }
28
- return htmlStr;
29
- }