长文本类型换行导出问题

长文本类型的列,有换行内容时,导出的excel有多余的换行,希望能优化下

2

这个问题很是影响我的使用,大量数据需要手工去掉重复的换行,这2天有空研究了一下,采用如下方法暴力解决:

#版本2.0

#进入docker
docker exec -it seatable /bin/bash

#修改文件commons.chunk.a75c26d801e6.js
vi /opt/seatable/seatable-server-2.0.0/dtable-web/media/assets/frontend/static/js/commons.chunk.a75c26d801e6.js

#修改4个地方

1、导出EXCEL时,每2行中间是2次换行
找到
(t.type===n.type&&“list”===n.type?r.push(n.ordered===t.ordered?"\n\n\n":"\n\n"):“list”!==n.type||“code”!==t.type||t.lang?r.push("\n\n"):r.push("\n\n\n"))
修改为
(t.type===n.type&&“list”===n.type?r.push(n.ordered===t.ordered?"\n":"\n"):“list”!==n.type||“code”!==t.type||t.lang?r.push("\n"):r.push("\n"))

2、导出EXCEL时,最后多了一个换行
找到
{“use strict”;e.exports=function(e){return this.block(e)+"\n"}}
修改为
{“use strict”;e.exports=function(e){return this.block(e)}}

3、输入关闭保存后,最后多一个换行
删除:
&&(“paragraph”===a.type&&ga.a.isEmptyParagraph(a)||ga.a.insertNodes(e,{type:“paragraph”,children:[{text:""}]},{at:[i[0]+1]}))

4、打开编辑器时,最后多一个换行
找到
1===n.length&&Object(a.b)(n[0])?n:(n.push({type:“paragraph”,children:[{text:""}]})
修改为
n

修改后保存文件,刷新浏览器页面即可。

未全面测试,目前正常,大家参考。