Liyuan Li 5 years ago
parent
commit
4bccb1a9a3
6 changed files with 12 additions and 1 deletions
  1. 3 1
      CHANGELOG.md
  2. 1 0
      src/index.ts
  3. 2 0
      src/ts/markdown/previewRender.ts
  4. 1 0
      src/ts/markdown/setLute.ts
  5. 1 0
      src/ts/util/Options.ts
  6. 4 0
      types/index.d.ts

+ 3 - 1
CHANGELOG.md

@@ -63,9 +63,11 @@
 
 * [open issues](https://github.com/Vanessa219/vditor/issues)
 * [346](https://github.com/Vanessa219/vditor/issues/346) 内容主题推荐(长期有效) `改进功能`
+* [390](https://github.com/Vanessa219/vditor/issues/390) no data-marker(editing mode) `修复缺陷`
 
 ### v3.2.4 / 2020-05-xx
 
+* [389](https://github.com/Vanessa219/vditor/issues/389) marker option at preview `改进功能`
 * [388](https://github.com/Vanessa219/vditor/pull/388) changed some korean i18n and demo text `文档相关`
 
 ### v3.2.3 / 2020-05-09
@@ -90,8 +92,8 @@
 * [370](https://github.com/Vanessa219/vditor/issues/370) Copy Paste multiline at markdown mode `改进功能`
 * 文档修改
   * 为 `options.upload` 添加 `extraData`
-  * 为 `IMarkdownConfig` 添加 `sanitize` 配置
   * 添加静态方法 `mindmapRender`
+  * 为 `IMarkdownConfig` 添加 `sanitize`, `listMarker` 配置
 
 ### v3.1.23 / 2020-05-05
 

+ 1 - 0
src/index.ts

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

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

@@ -34,6 +34,7 @@ const mergeOptions = (options?: IPreviewOptions) => {
             codeBlockPreview: true,
             fixTermTypo: false,
             footnotes: true,
+            listMarker: false,
             paragraphBeginningSpace: false,
             sanitize: true,
             setext: true,
@@ -78,6 +79,7 @@ export const md2html = (mdText: string, options?: IPreviewOptions) => {
             headingAnchor: mergedOptions.anchor,
             inlineMathDigit: mergedOptions.math.inlineDigit,
             lazyLoadImage: mergedOptions.lazyLoadImage,
+            listMarker: mergedOptions.markdown.listMarker,
             paragraphBeginningSpace: mergedOptions.markdown.paragraphBeginningSpace,
             sanitize: mergedOptions.markdown.sanitize,
             setext: mergedOptions.markdown.setext,

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

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

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

@@ -87,6 +87,7 @@ export class Options {
                 codeBlockPreview: true,
                 fixTermTypo: false,
                 footnotes: true,
+                listMarker: false,
                 sanitize: true,
                 setext: false,
                 theme: "light",

+ 4 - 0
types/index.d.ts

@@ -122,6 +122,8 @@ interface ILute {
 
     SetChineseParagraphBeginningSpace(enable: boolean): void;
 
+    SetRenderListMarker(enable: boolean): void;
+
     SetSanitize(enable: boolean): void;
 
     SetHeadingAnchor(enable: boolean): void;
@@ -327,6 +329,8 @@ interface IMarkdownConfig {
     sanitize: boolean;
     /** 内容主题。默认值:light */
     theme?: string;
+    /** 为列表添加标记,以便[自定义列表样式](https://github.com/Vanessa219/vditor/issues/390) 默认值:false */
+    listMarker?: boolean;
 }
 
 /** @link https://hacpai.com/article/1549638745630#options-preview */