Liyuan Li 5 anos atrás
pai
commit
3dc12f115a
2 arquivos alterados com 6 adições e 5 exclusões
  1. 1 2
      CHANGELOG.md
  2. 5 3
      README.md

+ 1 - 2
CHANGELOG.md

@@ -114,9 +114,8 @@
   * insert line 默认快捷键由 `⌘-⇧-D` 修改为 `⌘-⇧-H`,添加下移 `⌘-⇧-D`、上移 `⌘-⇧-U` 快捷键,移除上传、编辑器模式切换快捷键
   * 为 `options.toolbar` 添加 toolbar 参数,最多可进行 3 级菜单
   * 为 `options.toolbar` 添加 outdent,indent, outline, insert-after, insert-before, 子菜单,code-theme, content-theme
-  
   * `setTheme` 方法添加 `conentTheme`, `codeTheme` 参数
-  * `options.preview.markdonw` 添加 `theme` 配置
+  * `options.preview.markdonw` 添加 `theme`, `setext` 配置
   * IPreviewOptions 添加 `after`,`lazyLoadImage`, `markdown.theme`,移除 `theme`
 
 ### v3.0.12 / 2020-04-06

+ 5 - 3
README.md

@@ -248,6 +248,8 @@ Can be filled with element `id` or element itself` HTMLElement`
 | toc | Insert Table of Contents | false |
 | footnotes | Footnotes | true |
 | codeBlockPreview |Whether to render code blocks in wysiwyg and ir modes | true |
+| theme | Content Theme | 'light' |
+| setext | Whether to parse the setext header | true |
 
 #### options.preview.math
 
@@ -368,7 +370,7 @@ xhr.send(JSON.stringify({url: src})); // src is the address of the image outside
 | html2md(value: string) | HTML to md |
 | tip(text: string, time: number) | notification. time is 0 will always display |
 | setPreviewMode(mode: "both" \| "editor" \| "preview") | Set preview mode |
-| setTheme(theme: "dark" \| "classic", codeTheme?: string) | Set theme |
+| setTheme(theme: "dark" \| "classic", contentTheme?: string, codeTheme?: string) | Set theme |
 | getCurrentMode(): string | Get the editor's current editing mode |
 
 #### static methods
@@ -391,7 +393,6 @@ previewElement: HTMLDivElement,   // Use this element for rendering
 markdown: string,  // The original markdown to be rendered
 options?: IPreviewOptions {  
  anchor?: boolean;  // Add an anchor to the title
- theme?: string;  // Theme: 'classic' | 'dark', default is 'classic'
  customEmoji?: { [key: string]: string };    // Custom emoji, default is {}
  lang?: (keyof II18nLang);    // Language, default is 'zh_CN'  
  emojiPath?: string;    // Emoji picture path 
@@ -403,7 +404,8 @@ options?: IPreviewOptions {
  transform?(html: string): string; // Callback method before rendering
  after?(): void; // Callback method after rendering
  cdn?: string; // Self-built CDN address
- lazyLoadImage?: string; // 可使用类似 "https://cdn.jsdelivr.net/npm/vditor/dist/images/img-loading.svg" 图片对原始图片进行懒加载
+ lazyLoadImage?: string; // use "https://cdn.jsdelivr.net/npm/vditor/dist/images/img-loading.svg" to lazy load image
+ markdown?: options.preview.markdown;
 }
 ```