Liyuan Li 5 years ago
parent
commit
45176a9d89
8 changed files with 27 additions and 20 deletions
  1. 7 0
      CHANGELOG.md
  2. 12 12
      demo/render.html
  3. 1 1
      demo/render.js
  4. 1 1
      src/index.ts
  5. 2 2
      src/ts/markdown/previewRender.ts
  6. 1 1
      src/ts/markdown/setLute.ts
  7. 1 1
      src/ts/util/Options.ts
  8. 2 2
      types/index.d.ts

+ 7 - 0
CHANGELOG.md

@@ -68,11 +68,18 @@
 
 ### v3.3.1 / 2020-06-xx
 
+* [494](https://github.com/Vanessa219/vditor/issues/494) 三种模式支持 list-style 样式 `改进功能`
+* [489](https://github.com/Vanessa219/vditor/issues/489) 为 vditor.b3log.org/demo 添加源码 `改进功能`
+* [493](https://github.com/Vanessa219/vditor/issues/493) 修复 XSS 过滤 `修复缺陷`
+
 ### v3.3.0 / 2020-06-15
+
 * [486](https://github.com/Vanessa219/vditor/pull/486) getCursorPosition 针对空行会得到错误数据 `修复缺陷`
 * [485](https://github.com/Vanessa219/vditor/issues/485) IR 模式下,<details>的编辑问题 `修复缺陷`
 * [484](https://github.com/Vanessa219/vditor/issues/484) 添加 TED 视频支持 `改进功能`
 * [480](https://github.com/Vanessa219/vditor/issues/480) Mindmap 和 Echarts 内容为空时会报错 `修复缺陷`
+* 文档修改
+  * `options.markdown.listMarker` 修改为 `options.markdown.listStyle`
 
 ### v3.2.12 / 2020-06-07
 

+ 12 - 12
demo/render.html

@@ -92,51 +92,51 @@
             background-color: var(--hover-background-color) !important;
         }
 
-        .vditor-reset ul[data-marker="*"] {
+        .vditor-reset ul[data-style="*"] {
             list-style-type: disc
         }
 
-        .vditor-reset ul[data-marker="*"] ul {
+        .vditor-reset ul[data-style="*"] ul {
             list-style-type: circle
         }
 
-        .vditor-reset ul[data-marker="*"] ul ul {
+        .vditor-reset ul[data-style="*"] ul ul {
             list-style-type: square
         }
 
-        .vditor-reset ul[data-marker="+"] {
+        .vditor-reset ul[data-style="+"] {
             list-style-type: "\2764";
         }
 
-        .vditor-reset ul[data-marker="+"] ul {
+        .vditor-reset ul[data-style="+"] ul {
             list-style-type: "\1f49a"
         }
 
-        .vditor-reset ul[data-marker="+"] ul ul {
+        .vditor-reset ul[data-style="+"] ul ul {
             list-style-type: "\1f49b"
         }
 
-        .vditor-reset ul[data-marker="-"] {
+        .vditor-reset ul[data-style="-"] {
             list-style-type: korean-hangul-formal
         }
 
-        .vditor-reset ul[data-marker="-"] ul {
+        .vditor-reset ul[data-style="-"] ul {
             list-style-type: decimal-leading-zero
         }
 
-        .vditor-reset ul[data-marker="-"] ul ul {
+        .vditor-reset ul[data-style="-"] ul ul {
             list-style-type: lower-alpha
         }
 
-        .vditor-reset ol[data-marker="1)"] {
+        .vditor-reset ol[data-style="1)"] {
             list-style-type: simp-chinese-formal
         }
 
-        .vditor-reset ol[data-marker="1)"] ol {
+        .vditor-reset ol[data-style="1)"] ol {
             list-style-type: simp-chinese-informal
         }
 
-        .vditor-reset ol[data-marker="1)"] ol ol {
+        .vditor-reset ol[data-style="1)"] ol ol {
             list-style-type: trad-chinese-formal
         }
 

+ 1 - 1
demo/render.js

@@ -16,7 +16,7 @@ const render = (fileName) => {
         markdown, {
           markdown: {
             toc: true,
-            listMarker: fileName === 'cute-list',
+            listStyle: fileName === 'cute-list',
           },
           speech: {
             enable: true,

+ 1 - 1
src/index.ts

@@ -118,7 +118,7 @@ class Vditor extends VditorMethod {
                 headingAnchor: false,
                 inlineMathDigit: this.vditor.options.preview.math.inlineDigit,
                 linkBase: this.vditor.options.preview.markdown.linkBase,
-                listMarker: this.vditor.options.preview.markdown.listMarker,
+                listStyle: this.vditor.options.preview.markdown.listStyle,
                 paragraphBeginningSpace: this.vditor.options.preview.markdown.paragraphBeginningSpace,
                 sanitize: this.vditor.options.preview.markdown.sanitize,
                 setext: this.vditor.options.preview.markdown.setext,

+ 2 - 2
src/ts/markdown/previewRender.ts

@@ -35,7 +35,7 @@ const mergeOptions = (options?: IPreviewOptions) => {
             fixTermTypo: false,
             footnotes: true,
             linkBase: "",
-            listMarker: false,
+            listStyle: false,
             paragraphBeginningSpace: false,
             sanitize: true,
             setext: false,
@@ -81,7 +81,7 @@ export const md2html = (mdText: string, options?: IPreviewOptions) => {
             inlineMathDigit: mergedOptions.math.inlineDigit,
             lazyLoadImage: mergedOptions.lazyLoadImage,
             linkBase: mergedOptions.markdown.linkBase,
-            listMarker: mergedOptions.markdown.listMarker,
+            listStyle: mergedOptions.markdown.listStyle,
             paragraphBeginningSpace: mergedOptions.markdown.paragraphBeginningSpace,
             sanitize: mergedOptions.markdown.sanitize,
             setext: mergedOptions.markdown.setext,

+ 1 - 1
src/ts/markdown/setLute.ts

@@ -13,7 +13,7 @@ export const setLute = (options: ILuteOptions) => {
     lute.SetSetext(options.setext);
     lute.SetSanitize(options.sanitize);
     lute.SetChineseParagraphBeginningSpace(options.paragraphBeginningSpace);
-    lute.SetRenderListMarker(options.listMarker);
+    lute.SetRenderListStyle(options.listStyle);
     lute.SetLinkBase(options.linkBase);
     if (options.lazyLoadImage) {
         lute.SetImageLazyLoading(options.lazyLoadImage);

+ 1 - 1
src/ts/util/Options.ts

@@ -88,7 +88,7 @@ export class Options {
                 fixTermTypo: false,
                 footnotes: true,
                 linkBase: "",
-                listMarker: false,
+                listStyle: false,
                 sanitize: true,
                 setext: false,
                 theme: "light",

+ 2 - 2
types/index.d.ts

@@ -122,7 +122,7 @@ interface ILute {
 
     SetChineseParagraphBeginningSpace(enable: boolean): void;
 
-    SetRenderListMarker(enable: boolean): void;
+    SetRenderListStyle(enable: boolean): void;
 
     SetLinkBase(url: string): void;
 
@@ -332,7 +332,7 @@ interface IMarkdownConfig {
     /** 链接前缀。默认值:'' */
     linkBase?: string;
     /** 为列表添加标记,以便[自定义列表样式](https://github.com/Vanessa219/vditor/issues/390) 默认值:false */
-    listMarker?: boolean;
+    listStyle?: boolean;
 }
 
 /** @link https://hacpai.com/article/1549638745630#options-preview */