How to use the prosemirror-markdown.defaultMarkdownParser.parse function in prosemirror-markdown

To help you get started, we’ve selected a few prosemirror-markdown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eljefedelrodeodeljefe / vue-prosemirror-2 / index.js View on Github external
function mtodoc () {
          self.content.editor = defaultMarkdownParser.parse(area.value)
          self.content.markdown = area.value
          self.$emit('_content-change-markdown')
        }
        // emulate v-model
github eljefedelrodeodeljefe / vue-prosemirror-2 / index.js View on Github external
'setupProseMirror': function (content, editor) {
        const self = this

        this.view = new MenuBarEditorView(editor, {
          state: EditorState.create({
            doc: defaultMarkdownParser.parse(content),
            plugins: exampleSetup({schema})
          }),
          onAction: (action) => {
            self.$emit('_content-change-editor', action)
            self.content.editor = this.view.editor.state.doc
            self.content.markdown = defaultMarkdownSerializer.serialize(this.view.editor.state.doc)
          }
        })
        this.view.editor.focus()
      },
      'bindTextarea': function (area) {
github eljefedelrodeodeljefe / vue-prosemirror-2 / index.js View on Github external
this.$on('_content-change-markdown', () => {
        if (this.mode === 'all') {
          const state = EditorState.create({
            doc: defaultMarkdownParser.parse(this.content.markdown),
            plugins: exampleSetup({schema})
          })
          this.view.editor.updateState(state)
        }
        this.$emit('content-change-markdown')
      })
github ProseMirror / website / example / markdown / index.js View on Github external
constructor(target, content) {
    this.view = new EditorView(target, {
      state: EditorState.create({
        doc: defaultMarkdownParser.parse(content),
        plugins: exampleSetup({schema})
      })
    })
  }
github fiatjaf / coisas / components / ProseMirror.js View on Github external
start (value = '') {
    this.value = value

    this.state = EditorState.create({
      doc: defaultMarkdownParser.parse(value),
      plugins: exampleSetup({schema})
    })
    this.view = new EditorView(this.node, {
      state: this.state,
      dispatchTransaction: (txn) => {
        let nextState = this.view.state.apply(txn)
        this.view.updateState(nextState)
        this.dchanged(txn)
      }
    })
  }