uawdijnntqw1x1x1
IP : 216.73.216.107
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
.
/
vendor
/
.
/
craftcms
/
cms
/
src
/
gql
/
directives
/
Markdown.php
/
/
<?php /** * @link https://craftcms.com/ * @copyright Copyright (c) Pixel & Tonic, Inc. * @license https://craftcms.github.io/license/ */ namespace craft\gql\directives; use craft\gql\base\Directive; use craft\gql\GqlEntityRegistry; use GraphQL\Language\DirectiveLocation; use GraphQL\Type\Definition\Directive as GqlDirective; use GraphQL\Type\Definition\FieldArgument; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\Type; use yii\helpers\Markdown as MarkdownHelper; /** * Markdown GraphQL Directive * * @author Pixel & Tonic, Inc. <support@pixelandtonic.com> * @since 3.3.1 */ class Markdown extends Directive { public const DEFAULT_FLAVOR = null; public const DEFAULT_INLINE_ONLY = false; /** * @inheritdoc */ public static function create(): GqlDirective { $typeName = static::name(); return GqlEntityRegistry::getOrCreate($typeName, fn() => new self([ 'name' => $typeName, 'locations' => [ DirectiveLocation::FIELD, ], 'args' => [ new FieldArgument([ 'name' => 'flavor', 'type' => Type::string(), 'defaultValue' => self::DEFAULT_FLAVOR, 'description' => 'The “flavor” of Markdown the input should be interpreted with. Accepts the same arguments as yii\\helpers\\Markdown::process().', ]), new FieldArgument([ 'name' => 'inlineOnly', 'type' => Type::boolean(), 'defaultValue' => self::DEFAULT_INLINE_ONLY, 'description' => 'Whether to only parse inline elements, omitting any `<p>` tags.', ]), ], 'description' => 'Parses the passed field value as Markdown.', ])); } /** * @inheritdoc */ public static function name(): string { return 'markdown'; } /** * @inheritdoc */ public static function apply(mixed $source, mixed $value, array $arguments, ResolveInfo $resolveInfo): mixed { $inlineOnly = $arguments['inlineOnly'] ?? self::DEFAULT_INLINE_ONLY; if ($inlineOnly) { return MarkdownHelper::processParagraph((string)$value, $arguments['flavor'] ?? self::DEFAULT_FLAVOR); } return MarkdownHelper::process((string)$value, $arguments['flavor'] ?? self::DEFAULT_FLAVOR); } }
/srv/users/craft4/apps/craft4-newsite-space/./vendor/./craftcms/cms/src/gql/directives/Markdown.php