Browse Source

:arrow_up: lute

Liyuan Li 5 years ago
parent
commit
54115fda29
7 changed files with 17 additions and 14 deletions
  1. 1 4
      CHANGELOG.md
  2. 3 0
      demo/index.js
  3. 3 0
      demo/static-preview.html
  4. 1 1
      package-lock.json
  5. 1 1
      package.json
  6. 0 0
      src/js/lute/lute.min.js
  7. 8 8
      src/ts/markdown/md2html.ts

+ 1 - 4
CHANGELOG.md

@@ -49,13 +49,10 @@
 
 * [open issues](https://github.com/Vanessa219/vditor/issues)
 
-### v3.0.4 / 未发布
+### v3.0.4 / 2020-03-25
 
 * [232](https://github.com/Vanessa219/vditor/issues/232) 【IR&WYSIWYG】围栏代码块 info 部分自动完成 `引入特性`
 * [230](https://github.com/Vanessa219/vditor/pull/230) 切换 IR 模式后依然展示工具栏 `改进功能`
-
-### v3.0.3 / 2020-03-20
-
 * [27](https://github.com/Vanessa219/vditor/issues/27) 支持类似 Typora 的及时渲染模式 `引入特性`
 * [229](https://github.com/Vanessa219/vditor/issues/229) 初始化时不应该自动获取焦点 `改进功能`
 * [228](https://github.com/Vanessa219/vditor/pull/228) menu misplaced when vditor is not first child `改进功能`

+ 3 - 0
demo/index.js

@@ -10,6 +10,9 @@ window.vditor = new Vditor('vditor', {
     markdown: {
       toc: true,
     },
+    hljs: {
+      style: 'native'
+    }
   },
   counter: 100,
   height: 500,

+ 3 - 0
demo/static-preview.html

@@ -650,6 +650,9 @@ https://www.youtube.com/watch?v=S4xoOW4DVKE
   }
   Vditor.preview(document.getElementById('preview'),
     textElement.textContent, {
+      hljs: {
+        style: 'native'
+      },
       speech: {
         enable: true,
       },

+ 1 - 1
package-lock.json

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

+ 1 - 1
package.json

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

File diff suppressed because it is too large
+ 0 - 0
src/js/lute/lute.min.js


+ 8 - 8
src/ts/markdown/md2html.ts

@@ -2,15 +2,15 @@ import {VDITOR_VERSION} from "../constants";
 import {addScript} from "../util/addScript";
 
 export const loadLuteJs = (vditor: IVditor | string) => {
-    // let cdn = `https://cdn.jsdelivr.net/npm/vditor@${VDITOR_VERSION}`;
-    // if (typeof vditor === "string" && vditor) {
-    //     cdn = vditor;
-    // } else if (typeof vditor === "object" && vditor.options.cdn) {
-    //     cdn = vditor.options.cdn;
-    // }
-    // addScript(`${cdn}/dist/js/lute/lute.min.js`, "vditorLuteScript");
+    let cdn = `https://cdn.jsdelivr.net/npm/vditor@${VDITOR_VERSION}`;
+    if (typeof vditor === "string" && vditor) {
+        cdn = vditor;
+    } else if (typeof vditor === "object" && vditor.options.cdn) {
+        cdn = vditor.options.cdn;
+    }
+    addScript(`${cdn}/dist/js/lute/lute.min.js`, "vditorLuteScript");
     // addScript(`/src/js/lute/lute.min.js`, "vditorLuteScript");
-    addScript(`http://192.168.2.248:9090/lute.min.js?${new Date().getTime()}`, "vditorLuteScript");
+    // addScript(`http://192.168.2.248:9090/lute.min.js?${new Date().getTime()}`, "vditorLuteScript");
 
     if (vditor && typeof vditor === "object" && !vditor.lute) {
         vditor.lute = Lute.New();

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