reader-shell 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/txtReader.js +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reader-shell",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "cli.js",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/txtReader.js CHANGED
@@ -151,6 +151,7 @@ function parseTxt(txtPath) {
151
151
  return chapter
152
152
  .replace(/\r\n/g, '\n') // 统一换行符
153
153
  .replace(/\n{3,}/g, '\n\n') // 去除多余的空行
154
+ .replace(/\s+/g, '') // 删除所有空格和换行
154
155
  .trim();
155
156
  }).filter(chapter => chapter.length > 0);
156
157