Skip to content

Instantly share code, notes, and snippets.

@copperwall
Created December 14, 2016 07:23
Show Gist options
  • Save copperwall/c8f75c80f770dc5492e655714318c91c to your computer and use it in GitHub Desktop.
Save copperwall/c8f75c80f770dc5492e655714318c91c to your computer and use it in GitHub Desktop.
let serializer = pm.wikitext.serializer
// Grab the JSON document from the current editor.
let doc = view.editor.state.doc.toJSON()
// Pass the JSON document to the editor and assign output to wikitext.
let wikitext = serializer.serialize(doc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment