@seafile/sdoc-editor 1.0.2 → 1.0.3

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.
@@ -7,17 +7,19 @@ const listRule = (element, parseChild) => {
7
7
  childNodes
8
8
  } = element;
9
9
  if (nodeName === 'UL') {
10
+ const validChildNodes = Array.from(childNodes).filter(item => item.nodeName === 'LI');
10
11
  return {
11
12
  id: slugid.nice(),
12
13
  type: UNORDERED_LIST,
13
- children: parseChild(childNodes)
14
+ children: parseChild(validChildNodes)
14
15
  };
15
16
  }
16
17
  if (nodeName === 'OL') {
18
+ const validChildNodes = Array.from(childNodes).filter(item => item.nodeName === 'LI');
17
19
  return {
18
20
  id: slugid.nice(),
19
21
  type: ORDERED_LIST,
20
- children: parseChild(childNodes)
22
+ children: parseChild(validChildNodes)
21
23
  };
22
24
  }
23
25
  if (nodeName === 'LI' && PARAGRAPH_TAGS.includes(element.firstChild.nodeName)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",