Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

How to get markdownit ? #32

Open
lhuangjs opened this issue Jul 13, 2019 · 1 comment
Open

How to get markdownit ? #32

lhuangjs opened this issue Jul 13, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@lhuangjs
Copy link

Version

"@toast-ui/vue-editor": "^1.1.1"

Test Environment

  • browser: Electron app, chrome

  • OS: Ubuntu18

Current Behavior

I wanted to get markdownit to do some pretreatment(replace some html tag, reformat html ... ) before preview. So I used invoke(getMarkdownitRenderer) . However, I get null.

reference: https://nhn.github.io/tui.editor/api/latest/Convertor.html#.getMarkdownitRenderer

<template>
  <div class="editor">
    <Editor
      ref="editor"
      v-model="editorContent"
      :options="editorOptions"
      height="100%"
      previewStyle="vertical"
      :visible="true"
      mode="markdown"
      @change="mdContentChanged"
    ></Editor>
  </div>
</template>

<script>
import 'tui-editor/dist/tui-editor.css'
import 'tui-editor/dist/tui-editor-contents.css'
import 'codemirror/lib/codemirror.css'
import { Editor } from '@toast-ui/vue-editor'

export default {

  name: 'MDEditor',

  props: ['markdownContent', 'imgPath', 'filePath'],

  components: { Editor },

  created () {
    console.log(this.imgPath)
  },

  mounted: function () {
    console.log(this.$refs.editor.invoke('getMarkdownitRenderer'))
 }
}
</script>

Expected Behavior

@sohee-lee7
Copy link
Contributor

Currently, we do not provide a function to take a markdownit instance in vue wrapper. So getMarkdownitRenderer does not work in vue wrapper. We are planning to provide this feature, so please wait a little.

@sohee-lee7 sohee-lee7 added the enhancement New feature or request label Jul 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants