DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:prosemirror:plugin_support

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
plugin:prosemirror:plugin_support [2018-07-23 15:48] – [The renderer] grosseplugin:prosemirror:plugin_support [2018-07-23 15:52] (current) – [The parser] grosse
Line 62: Line 62:
 ===== The parser ===== ===== The parser =====
  
 +The parser is used to translate the JSON from Prosemirror back to DokuWiki's syntax.
 +To parse you own node, you need to listen to the ''PROSEMIRROR_PARSE_UNKNOWN'' event.
 +This event is triggered in the abstract [[https://github.com/cosmocode/dokuwiki-plugin-prosemirror/blob/master/parser/Node.php|Node]] class and contains the following data:
  
 +<code php>
 +$eventData = [
 +    'node' => $node,
 +    'parent' => $parent,
 +    'previous' => $previous,
 +    'newNode' => null,
 +];
 +</code>
  
 +You need to prevent the default and return your instance of ''Node'' in the ''%%'newNode'%%'' key.
plugin/prosemirror/plugin_support.txt · Last modified: 2018-07-23 15:52 by grosse

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki