@seafile/seafile-editor 1.0.96 → 1.0.97

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.
@@ -139,6 +139,10 @@ const transformInlineChildren = (result, item) => {
139
139
  result.push(column);
140
140
  return result;
141
141
  }
142
+ if (item.type && item.type === 'html') {
143
+ result.push(item);
144
+ return result;
145
+ }
142
146
 
143
147
  // text
144
148
  const nodes = transformTextNode(item);
@@ -179,7 +183,8 @@ const transformParagraph = node => {
179
183
  }
180
184
  const voidNodeTypes = ['image', 'column', 'formula'];
181
185
  const hasBlock = children.some(item => voidNodeTypes.includes(item.type));
182
- if (!hasBlock && _slate.Node.string(node).length === 0) {
186
+ const hasHtml = children.some(item => item.type === 'html');
187
+ if (!hasHtml && !hasBlock && _slate.Node.string(node).length === 0) {
183
188
  return {
184
189
  type: 'paragraph',
185
190
  children: [
@@ -13,11 +13,17 @@ const replaceColumnData = (mdNodes, columns, getCellValue, updateImgUrl) => {
13
13
  const column = columns.find(column => column.key === data.key);
14
14
  const value = column ? getCellValue && getCellValue(column) : '';
15
15
  // change column node to text node
16
- const newNode = {
16
+ let newNode = {
17
17
  'text': value,
18
18
  'bold': data.bold,
19
19
  'italic': data.italic
20
20
  };
21
+ if (column.type === 'long-text') {
22
+ newNode = {
23
+ type: 'html',
24
+ value: value
25
+ };
26
+ }
21
27
  mdNodes.splice(i, 1, newNode);
22
28
  continue;
23
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "1.0.96",
3
+ "version": "1.0.97",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {