1<?php 2 3namespace dokuwiki\plugin\prosemirror\parser; 4 5class InterwikiLinkNode extends LinkNode 6{ 7 public function toSyntax() 8 { 9 return $this->getDefaultLinkSyntax($this->attrs['data-inner']); 10 } 11 12 public static function render(\renderer_plugin_prosemirror $renderer, $name, $wikiName, $wikiUri) 13 { 14 $shortcut = $wikiName; 15 $url = $renderer->_resolveInterWiki($shortcut, $wikiUri, $exists); 16 $additionalAttributes = [ 17 'data-resolvedUrl' => $url, 18 'data-resolvedClass' => 'interwikilink interwiki iw_' . $shortcut, 19 ]; 20 self::renderToJSON( 21 $renderer, 22 'interwikilink', 23 "$wikiName>$wikiUri", 24 $name, 25 $additionalAttributes 26 ); 27 } 28} 29