k] = $extArg->v; } return $ret; } public function sourceToDom(ParsoidExtensionAPI $extApi, string $src, array $extArgs): DocumentFragment { $src = preg_replace('/^([ ]*)([#*]+)/', '${1}${2}', $src); $args = $this->toArgs($extArgs); $type = 'block'; if (isset($args['inline'])) { $type = 'inline'; } $wrapperTag = ''; $contextType = ''; switch ($type) { case 'inline': $wrapperTag = 'span'; $contextType = 'inline'; break; case 'block': $wrapperTag = 'div'; $contextType = 'block'; break; } return $extApi->extTagToDOM( $extArgs, '', $src, [ 'wrapperTag' => $wrapperTag, 'parseOpts' => [ 'extTag' => 'veval', 'context' => $contextType ], ], );; } }