$text, 'node' => $node, // there are \b boundaries on either side, and first/last characters // are word characters. 'badPrefix' => /* RegExp */ '/\w$/uD', 'badSuffix' => /* RegExp */ '/^\w/u' ] ); } protected static function fromSelSerImpl( string $text, Element $node, DataParsoid $dataParsoid, Env $env, array $opts ): ?MagicLinkText { $stx = $dataParsoid->stx ?? null; if ( $stx === 'magiclink' ) { return new MagicLinkText( $text, $node ); } return null; } }