Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 747 Bytes

markdown.md

File metadata and controls

35 lines (27 loc) · 747 Bytes

Markdown-It

Get the markdown-it object of mavonEditor

method 1: Global Registration

  import MavonEditor from 'mavon-editor'
  Vue.use(MavonEditor)
  ...
  const markdownIt = MavonEditor.mavonEditor.getMarkdownIt()

method 2: Local Registration

  import {mavonEditor} from 'mavon-editor'
  const markdownIt = mavonEditor.getMarkdownIt()

method 3: Use mavonEditor ref

   <mavonEditor ref=md></mavonEditor>
   ...
   const markdownIt = this.refs.md.getMarkdownIt()

Use markdown-it object

eg: set the line break style

    // get markdownIt as above
    markdownIt.set({ breaks: false });

markdown-it API