Liyuan Li 5 years ago
parent
commit
856ad4de54
5 changed files with 9 additions and 8 deletions
  1. 4 3
      README.md
  2. 1 1
      demo/index.html
  3. 0 0
      demo/render.html
  4. 0 0
      demo/render.js
  5. 4 4
      webpack.start.js

+ 4 - 3
README.md

@@ -119,9 +119,9 @@ const vditor = new Vditor(id, {options...})
 
 ### Demo code
 
-* [CommonJS](https://github.com/Vanessa219/vditor/blob/master/demo/index.js)
+* [CommonJS Editor](https://github.com/Vanessa219/vditor/blob/master/demo/index.js)
+* [CommonJS Render](https://github.com/Vanessa219/vditor/blob/master/demo/render.js)
 * [HTML script](https://github.com/Vanessa219/vditor/blob/master/demo/static.html)
-* [Preview](https://github.com/Vanessa219/vditor/blob/master/demo/static-preview.html)
 * [Vue](https://github.com/88250/pipe/blob/master/console/pages/admin/articles/post/index.vue)
 
 ### Themes
@@ -252,6 +252,7 @@ Can be filled with element `id` or element itself` HTMLElement`
 | setext | Whether to parse the setext header | true |
 | paragraphBeginningSpace | Two spaces before the paragraph | false |
 | sanitize | Use XSS | true |
+| listMarker | add data-marker attribute | false |
 
 #### options.preview.math
 
@@ -395,7 +396,7 @@ VditorPreview.mermaidRender(document)
 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
+ anchor?: number;  // 0: no render, 1: render left, 2: render right
  customEmoji?: { [key: string]: string };    // Custom emoji, default is {}
  lang?: (keyof II18nLang);    // Language, default is 'zh_CN'  
  emojiPath?: string;    // Emoji picture path 

+ 1 - 1
demo/index.html

@@ -44,7 +44,7 @@
 <h2>
     <a href="https://github.com/vanessa219/vditor" target="_blank">GitHub</a> |
     <a href="https://hacpai.com/article/1549638745630?r=Vanessa" target="_blank">API</a> |
-    <a href="/preview.html">Preview</a> |
+    <a href="/render.html">Render</a> |
     <button onclick="window.vditor.setTheme('dark', 'dark',  'native');document.querySelector('body').style.backgroundColor='#2f363d'">Dark Mode</button>
     <button onclick="window.vditor.setTheme('light', 'light', 'github');document.querySelector('body').style.backgroundColor=''">Light Mode</button>
 </h2>

+ 0 - 0
demo/preview.html → demo/render.html


+ 0 - 0
demo/preview.js → demo/render.js


+ 4 - 4
webpack.start.js

@@ -21,7 +21,7 @@ module.exports = {
   },
   entry: {
     'index.js': './demo/index.js',
-    'preview.js': './demo/preview.js',
+    'render.js': './demo/render.js',
     'jest-puppeteer.js': './demo/jest-puppeteer.js',
   },
   resolve: {
@@ -114,9 +114,9 @@ module.exports = {
       template: './demo/index.html',
     }),
     new HtmlWebpackPlugin({
-      chunks: ['preview.js'],
-      filename: './preview.html',
-      template: './demo/preview.html',
+      chunks: ['render.js'],
+      filename: './render.html',
+      template: './demo/render.html',
     }),
     new HtmlWebpackPlugin({
       chunks: ['jest-puppeteer.js'],