Browse Source

:bug: fix https://github.com/Vanessa219/vditor/issues/1137

Vanessa 3 years ago
parent
commit
929e9bb987
3 changed files with 15305 additions and 7 deletions
  1. 15300 2
      package-lock.json
  2. 2 2
      package.json
  3. 3 3
      src/ts/upload/index.ts

File diff suppressed because it is too large
+ 15300 - 2
package-lock.json


+ 2 - 2
package.json

@@ -34,10 +34,10 @@
     "identity-obj-proxy": "^3.0.0",
     "jest": "^26.6.3",
     "mini-css-extract-plugin": "^0.8.2",
-    "node-sass": "^6.0.1",
+    "node-sass": "^7.0.0",
     "postcss-loader": "^5.2.0",
     "puppeteer": "^1.20.0",
-    "sass-loader": "^10.2.0",
+    "sass-loader": "^12.4.0",
     "style-loader": "^1.3.0",
     "terser-webpack-plugin": "^5.1.2",
     "ts-jest": "^26.5.6",

+ 3 - 3
src/ts/upload/index.ts

@@ -108,7 +108,7 @@ const genUploadedLabel = (responseText: string, vditor: IVditor) => {
         if (type.indexOf(".wav") === 0 || type.indexOf(".mp3") === 0 || type.indexOf(".ogg") === 0) {
             if (vditor.currentMode === "wysiwyg") {
                 succFileText += `<div class="vditor-wysiwyg__block" data-type="html-block"
- data-block="0"><pre><code>&lt;audio controls="controls" src="${path}"&gt;&lt;/audio&gt;</code></pre>`;
+ data-block="0"><pre><code>&lt;audio controls="controls" src="${path}"&gt;&lt;/audio&gt;</code></pre>\n`;
             } else if (vditor.currentMode === "ir") {
                 succFileText += `<audio controls="controls" src="${path}"></audio>\n`;
             } else {
@@ -123,13 +123,13 @@ const genUploadedLabel = (responseText: string, vditor: IVditor) => {
             || type.indexOf(".svg") === 0
             || type.indexOf(".webp") === 0) {
             if (vditor.currentMode === "wysiwyg") {
-                succFileText += `<img alt="${filename}" src="${path}">`;
+                succFileText += `<img alt="${filename}" src="${path}">\n`;
             } else {
                 succFileText += `![${filename}](${path})\n`;
             }
         } else {
             if (vditor.currentMode === "wysiwyg") {
-                succFileText += `<a href="${path}">${filename}</a>`;
+                succFileText += `<a href="${path}">${filename}</a>\n`;
             } else {
                 succFileText += `[${filename}](${path})\n`;
             }

Some files were not shown because too many files changed in this diff