Browse Source

:arrow_up:

Liyuan Li 5 years ago
parent
commit
40367ad0f3
5 changed files with 17 additions and 8 deletions
  1. 4 5
      CHANGELOG.md
  2. 1 1
      package-lock.json
  3. 1 1
      package.json
  4. 7 0
      src/ts/export/index.ts
  5. 4 1
      src/ts/toolbar/Export.ts

+ 4 - 5
CHANGELOG.md

@@ -57,14 +57,13 @@
 
 
 * [open issues](https://github.com/Vanessa219/vditor/issues)
 * [open issues](https://github.com/Vanessa219/vditor/issues)
 * [324](https://github.com/Vanessa219/vditor/issues/324) 支持多款主题预览 `引入特性`
 * [324](https://github.com/Vanessa219/vditor/issues/324) 支持多款主题预览 `引入特性`
-
-### v3.1.19 / 2020-04-2x
-
 * [325](https://github.com/Vanessa219/vditor/issues/325) 导出功能 `引入特性`
 * [325](https://github.com/Vanessa219/vditor/issues/325) 导出功能 `引入特性`
-* [341](https://github.com/Vanessa219/vditor/issues/341) Can not delete the image at IR mode `修复缺陷`
 
 
-### v3.1.18 / 2020-04-24
+### v3.1.20 / 2020-04-2x
 
 
+### v3.1.19 / 2020-04-26
+
+* [341](https://github.com/Vanessa219/vditor/issues/341) Can not delete the image at IR mode `修复缺陷`
 * [339](https://github.com/Vanessa219/vditor/issues/339) 添加静态方法 setCodeTheme, setContentTheme `改进功能`
 * [339](https://github.com/Vanessa219/vditor/issues/339) 添加静态方法 setCodeTheme, setContentTheme `改进功能`
 * [316](https://github.com/Vanessa219/vditor/issues/316) 支持多端预览 `引入特性`
 * [316](https://github.com/Vanessa219/vditor/issues/316) 支持多端预览 `引入特性`
 * [337](https://github.com/Vanessa219/vditor/issues/337) insertValue 光标错误 `修复缺陷`
 * [337](https://github.com/Vanessa219/vditor/issues/337) insertValue 光标错误 `修复缺陷`

+ 1 - 1
package-lock.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "vditor",
   "name": "vditor",
-  "version": "3.1.18",
+  "version": "3.1.19",
   "lockfileVersion": 1,
   "lockfileVersion": 1,
   "requires": true,
   "requires": true,
   "dependencies": {
   "dependencies": {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "vditor",
   "name": "vditor",
-  "version": "3.1.18",
+  "version": "3.1.19",
   "description": "♏ 一款浏览器端的 Markdown 编辑器。",
   "description": "♏ 一款浏览器端的 Markdown 编辑器。",
   "author": "Vanessa <[email protected]> (http://vanessa.b3log.org)",
   "author": "Vanessa <[email protected]> (http://vanessa.b3log.org)",
   "homepage": "https://hacpai.com/tag/vditor",
   "homepage": "https://hacpai.com/tag/vditor",

+ 7 - 0
src/ts/export/index.ts

@@ -70,3 +70,10 @@ export const exportHTML = (vditor: IVditor) => {
 </script>`;
 </script>`;
     download(vditor, html, content.substr(0, 10) + ".html");
     download(vditor, html, content.substr(0, 10) + ".html");
 };
 };
+
+export const exportWeChat = (vditor: IVditor) => {
+    vditor.tip.show("已复制,请到微信公众平台粘贴");
+    // https://github.com/mdnice/markdown-nice/blob/d34ce36799fbe485b27fe8dfbab2b7c60c46e064/src/utils/converter.js
+    // /src/component/Sidebar/Wechat.js
+    // https://mdnice.com/
+};

+ 4 - 1
src/ts/toolbar/Export.ts

@@ -1,4 +1,4 @@
-import {exportHTML, exportMarkdown, exportPDF} from "../export";
+import {exportHTML, exportMarkdown, exportPDF, exportWeChat} from "../export";
 import {getEventName} from "../util/compatibility";
 import {getEventName} from "../util/compatibility";
 import {MenuItem} from "./MenuItem";
 import {MenuItem} from "./MenuItem";
 import {hidePanel, toggleSubMenu} from "./setToolbar";
 import {hidePanel, toggleSubMenu} from "./setToolbar";
@@ -14,6 +14,7 @@ export class Export extends MenuItem {
         panelElement.innerHTML = `<button data-type="markdown">Markdown</button>
         panelElement.innerHTML = `<button data-type="markdown">Markdown</button>
 <button data-type="pdf">PDF</button>
 <button data-type="pdf">PDF</button>
 <button data-type="html">HTML</button>`;
 <button data-type="html">HTML</button>`;
+        // <button data-type="wechat">复制到公众号</button>
         panelElement.addEventListener(getEventName(), (event: MouseEvent & { target: HTMLElement }) => {
         panelElement.addEventListener(getEventName(), (event: MouseEvent & { target: HTMLElement }) => {
             const btnElement = event.target;
             const btnElement = event.target;
             if (btnElement.tagName === "BUTTON") {
             if (btnElement.tagName === "BUTTON") {
@@ -26,6 +27,8 @@ export class Export extends MenuItem {
                         break;
                         break;
                     case "html":
                     case "html":
                         exportHTML(vditor);
                         exportHTML(vditor);
+                    case "wechat":
+                        exportWeChat(vditor);
                         break;
                         break;
                     default:
                     default:
                         break;
                         break;